Use Linux commands to delete spam files.The main command we use here is find. For example, after deleting an account, some useless junk files and directories will exist. To find out the junk items belonging to this user, use the find/-user Username: you can find the user-related files in the root directory and run the following command:
#find ./ -nouser |xargs rm –rf
Core FileWhen an error occurs when a program is running in the system, the system automatically saves the data that remains in the memory as core files. Over time, more and more cores will be left in the system, it is annoying to scatter like dust in every corner of the system. At this time, we can apply the find command and add the-exec parameter to clear them. Run the following command:
# find / -name core -print -exec rm -rf {} ;
Additional manual pagesIn addition, Linux provides many language manual pages (man). For example, the Ubuntu manual page is located in the/usr/share/man directory. You can use commands to delete the manual pages of redundant languages and keep them in Chinese and English.
# cd /usr/share/man# find ./ -maxdepth 1 -type d | tail -n +2 | grep -E -v '(en|zh|man).*' | while read d; do rm -rf $d; done
Note: The keyword is (en | zh | man). You can modify the keyword as needed.
Use fdupes to delete duplicate files in a specified directory
Fdupes is a command line tool that searches for and deletes duplicate files in a specified directory. It compares the file size with the MD5 value. Compare one byte to one byte. First install this tool
# apt-get install fdupes
Run the following command to find duplicate files in the/etc directory:
#fdupes /etc
It can be used in combination with Linux commands to delete files:
#fdupes -r -f . | grep -v ^$ | tee duplicate.txt cat duplicate.txt | while read file; do rm -v "$file"; done
You can also use the sed command to delete files:
# fdupes -r -n -S /tmp | sed -r “s/^/#rm ”/” | sed -r “s/$/”/” >duplicate-files.sh
Delete cached filesClear old software caches
# apt-get autoclean
Clear all software caches:
#apt-get clean
Use the Geeqie tool to find similar image filesThe current hard disk capacity is getting bigger and bigger. Due to backup considerations, many friends will save the image by taking the principle of "Please do not miss it", which may lead to duplicate files, the efficiency of file search is low. It is not easy to find duplicate documents in massive buckets. In fact, with the famous image browsing tool Geeqie, you can easily find duplicate and similar image files in the system. These files are larger than text files, occupying a lot of hard disk space for a long time. The fdupes tool described above does not work, because the fdupes tool can only delete duplicate files identical (md5sum is the same), but to remove "similar" image files, you can use the geeqie tool. First install this tool:
# apt-get install gqview
Run the tool below, right-click the directory to be searched, and select "Find duplicates recursive...", as shown in figure 1.
Select the "Compare by:" drop-down menu in the lower left corner to select the matching method Similarity (custom) to find the image with a Similarity of more than 99%. You can also select "Thumbnails" to display the thumbnail, as shown in figure 2.
Right-click the selected project and click "Delete" to Delete all selected images. A confirmation interface is provided before deletion to avoid accidental deletion. Note: 99% is the default value of image similarity. You can modify the parameters in the following way: Edit → Preferences... → Behavior → Miscellaneous: Custom similarity threshold, as shown in figure 3.
Introduction to using BleachBit to clear filesBleachBit is an open-source free system cleanup tool that features similar features to CCleaner on Windows. BleachBit can delete hidden junk files and easily protect your privacy. It is a very practical cross-platform system cleanup tool that can erase cache, delete cookies, clear Internet browsing history, delete unused localized fragment logs, and delete temporary files. BleachBit provides rpm and deb Binary packages. It is applicable to Linux ora, CentOS, RHEL, Debian, Ubuntu, and other Linux distributions. Other Linux users can choose BleachBit source code package (: http://bleachbit.sourceforge.net/download.PHP ). With BleachBit, you can clear unwanted items such as cache, history, temporary files, and cookies in the system, so that you can release your disk space. Currently, BleachBit can clean up junk files generated by more than 70 software programs, such as Beagle, Firefox, Epiphany, Flash, OpenOffice.org, KDE, GIMP, JAVA programming tools, vim, and Gedit editors. There are also "Thumbs. db" files generated during system running, cache files generated during installation using apt or YUM software packages, and historical files in the clipboard.
First install the software:
#apt-get install bleachbit
After installation, there will be two more tools in the System Tool menu: bleachbit and bleachbitasroot. If you use 2nd root users and the software runs for the first time, the "Preference window" is displayed, as shown in figure 4.
A brief description of the settings page: Includes custom files and folders, drive list, language, whitelist (exempt from cleanup) settings, and whether to enable BleachBit at startup.
See Figure 5.
BleachBit is easy to use because it has a single function. As shown in figure 5. On the left side of the software, various Spam items can be cleared. Click the "preview" button to analyze the details and sizes of the spam files. Select the software and press the clean button.
Use Chrome as an example to describe how to operateFiles that can be cleaned by Chrome include:
- Cache: Delete the cached webpage files (these cached files can reduce the next time you access the webpage)
- Cookies: delete cookies. They store website preferences, authentication, and identity information.
- Current session: Delete the current session
- DOM (Document Object Model) Storage: delete HTML5cookies
- Form history: website form input history
- History: deletes historical records of browsed websites, downloads, and thumbnails.
- Search engine: resets the use history of search engines and deletes non-built-in search engines.
- Database sorting: CLEAR database fragments to reduce space and increase the speed (no data needs to be deleted)
First, view the cleanup Chrome browser file, as shown in figure 6.
After selecting the project you want to clean up, click the "preview" button to scan the junk files contained in the project. The scan process is fast and complete, the user will see the list of detected junk files and their statistics. The following users can easily clear these detected junk files by clicking the "clear" button.
The above I chose to execute a scan cleaning task for the Chrome browser. Of course, you can select all items in the whole junk list. You only need to select scan items and select activation items one by one.
Use Activity Log Manager to clear traces of use left in the systemSurfing the Internet, logging on to the system with an account, including using some editing software, leaves clues in the system. The residual information contains personal information. If exploited by criminals, this will cause privacy leakage, the tool described below is Activity Log Manager, which is configured to be recorded in Zeitgeist Activity logs and can be used to effectively protect privacy. First install this tool:
#apt-get install activity-log-manager
The Chinese name of Activity Log Manager is the Activity Log Manager, which is displayed in the attachment menu after installation. It is easy to use. The most direct is to set the stop record function, and then delete all historical files, as shown in figure 7.
Of course, you can also set different settings. You can set which applications and files can be retained based on the actual situation. See Figure 8.
Here, I select "workbooks, text, and instant messages" as privacy-related options. You can also add some special applications to the activity log manager, as shown in figure 9.
Use GConf Cleaner to clear GConfGConf is a system used to store the GNOME application options. If the system is filled with a lot of useless key values, it will make GConf bloated. This affects the startup speed and performance of the application. To solve this problem, you can use GConf Cleaner to clean it. Gconf-Cleaner is a tool similar to Windows Registry Cleaner. It checks the Gconf database (that is, the GNOME configuration database) and removes useless and outdated projects.
First install this tool:
#apt-get install gconf-cleaner
Then run gconf-cleaner from the terminal to start the GConf Cleaner program. This program has an execution wizard, you only need to follow the steps. Wizard initial screen. Click Forward to go to the analysis process. Figure 10 shows the analysis result, which provides specific data and can be saved. Click "Forward" again to start the cleaning process.