Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to clean up junk files in Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you about how to clean up junk files in Linux. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

The clean command deletes all software installation packages.

When the network connection is normal, we execute the software installation command, and after the software installation is finished, the software package with the suffix .deb is no longer needed. This situation is similar to the situation on the Windows platform and the Android platform of mobile phones. We can clean up these software installation packages that are no longer needed on a regular basis.

Ctrl + Alt + t bring up the terminal, type the following command and execute:

Sudo apt-get clean

You can delete all software installation packages stored on your local computer.

As shown in the figure, it actually deletes all files that end in .deb in the / var/cache/apt/archives directory.

Second, the autoclean command removes software installation packages that are no longer available.

This command is similar to clean, except that it selectively removes packages: installation packages that are no longer available (for example, you can no longer download the current version or newer version of the package from the software repository).

Execute within the terminal:

Sudo apt-get autoclean

Software installation packages that are no longer available can be deleted.

Third, the remove command deletes specific software.

Similar to the Program Uninstall Command in the Windows Control Panel, the remove command removes software.

Execute within the terminal:

Sudo apt-get remove Software name

The corresponding software can be deleted.

Fourth, use the purge command to delete the software "residue".

The purge command is another version of the remove command, which removes residual settings from the package while deleting the software itself. Similar to the "software residue" cleanup after the software is deleted in the Windows environment.

Execute in the terminal:

Sudo apt-get purge Software name

The relevant software will be deleted, and the configuration file of the software will be deleted.

The autoremove command removes dependent packages that are no longer needed.

For example, we install software A, but A depends on package B. when An is installed, B must also be installed.

One day, when we no longer need software An and delete it, we can use the autoremove command to delete the software B that was installed to satisfy A's dependency.

It sounds a little bit like a bridge across the river.

In summary, you can delete dependent packages that are no longer needed by executing the following command:

Sudo apt-get autoremove

This is common during kernel upgrades: when a new kernel is installed, you can delete the old kernel with the above command.

Sixth, clean up the browser's cache files.

Take the FireFox browser as an example, click the three bars in the upper right corner of the browser-- > History-- > clear the most recent history, and you can choose to clear the most recent or all browsing history in the pop-up dialog box.

Clear the document cache file.

If the computer is suddenly forced to shut down or restart while viewing the document, the document being viewed will leave a cache file starting with ". ~" in the current working directory. If these cache files are not necessary to restore, you can delete them.

Open the file window on the launcher bar, navigate to the target folder, and press Ctrl + h to show the hidden files, then the hidden files under the current folder will be revealed, such as the above document cache files. You can delete it as appropriate.

The above is how to clean up junk files in Linux. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report