Which files in Linux are spam files?

Source: Internet
Author: User
Tags clear internet ssh server

Which files in Linux are spam files?

After the Linux computer is installed, during our continuous use, various junk files will be generated in the hard disk due to activities such as adding and deleting software and surfing the Internet, debugging programs, etc, as these junk files continue to expand, they will not only flat our valuable hard disk space, but also drag down the running speed of the machine and affect our work efficiency. This article describes how to use the tool and weight loss methods for Linux. the Linux release version used in this article is Ubuntu12.04. Tools described in this article include Activity Log Manager, BleachBit, find, fdupes, Geeqie, and GConf Cleaner. These tools are all open-source tools, linux users can download and compile the source code in other popular Linux versions (such as Redhat and SUSE.

Which files in Linux are spam files?

Temporary files generated during software installation

When installing many bin-format software, you must first extract the installation file to a temporary directory (usually the/tmp directory) and then install it. If the software design is neglected or the system is faulty, after the installation is complete, these temporary files will become non-"temporary" and become a pile of garbage in the hard disk. In many cases, they use *. tmp faces appear.

Temporary files generated during software running

Like the installation process, some temporary exchange files are usually generated during the operation of the Software. After some software runs, the garbage may even reach hundreds of megabytes, for example, files generated when the ssh server and client are connected. There are also files generated when the VM is running. In addition, some useless junk files and directories will exist after we delete an account.

Temporary files generated by surfing the internet

When we access the Internet, the browser always downloads webpage files to a local machine. These cached files not only occupy valuable disk space, but also often make our privacy public.

Some infrequently used chicken ribs files

For example, some application software comes with help and system manual pages. Since they are tasteless, they are also seen as a manifestation of junk files. A large amount of space is occupied, which seriously slows down the running speed of the system and some graphics processing software. There are also some corrupted desktop files, including damaged Application menu buttons and file associations.

Various cached files

If a Linux user installs and uses GIMP, Geeqie, and other graphical editing tools, the image preview function is available in these software. In the folder where the image is saved, a file named "Thumbs. db file, this file will expand with the increase of image files. There is also the. DS_Store file. The DS_Store file is used to store the display attributes of this folder, such as the placement location of the file icon. The side effect after deletion is the loss of such information. In addition, cache files generated during installation using apt or yum software package.

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 File

When 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 pages

In 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 files

Clear old software caches

# apt-get autoclean

Clear all software caches:

#apt-get clean
Use the Geeqie tool to find similar image files

The 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 files

BleachBit 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 operate

Files 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 system

Surfing 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 GConf

GConf 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.