Home > Article > Operation and Maintenance > What file is tmp in linux?
In Linux, tmp is a temporary file; tmp is the abbreviation of temporary. The role of the tmp directory is to store temporary files. The tmp directory will clear files that have not been used for a specified number of days by default. The system restart will clear the directory, "/ tmp" directory by default clears files that have not been used for 10 days, and the "/var/tmp" directory clears files that have not been used for 30 days by default.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
tmp is the abbreviation of temporary (temporary). This directory is used to store some temporary files
/tmp is a temporary folder under Linux.
Generally, the contents in this folder do not need to be deleted. Taking redhat as an example, the default time limit for the system to automatically clean up the /tmp folder is 30 days. Files under /tmp that are not accessed for 30 days will be automatically deleted by the system.
/tmp
– The temporary file directory can be accessed by any user or any program. It is generally used to store temporary files of the program, so it should be cleaned regularly. FHS even recommends that when booting, all data under /tmp
should be deleted, as well as the temporary directory /var/tmp
.
Linux has two well-known temporary directories: /tmp
and /var/tmp
. These two directories are used by users to store temporary files. Stores temporary data that is often read and written by users.
There is no essential difference between the two directories. The most fundamental difference is that the system's default time configuration for file cleaning is inconsistent.
/tmp
The directory is cleared of files that have not been used for 10 days by default. The system restart will clear the directory
/var/tmp
The directory is cleared for 30 days by default Unused files
Extended knowledge
/media
-Mount point directory, media is the English word for "media", as the name implies , the removable device is placed under this /media! Devices including floppy disks, optical disks, DVDs, etc. are temporarily mounted here. Common file names are: /media/floppy, /media/cdrom, etc.
/mnt
– Mount point directory. If you want to temporarily mount some additional devices, it is generally recommended that you place it in this directory. When writing earlier, this directory The purpose is the same as /media! Only after /media is created, this directory is used for temporary mounting.
/opt
– Optional directory. This is the directory where third-party collaborative software is placed. What is third-party collaborative software? For example, the KDE desktop management system is an independent project, but it can be installed on a Linux system, so it is recommended that KDE software be placed in this directory. In addition, if you want to install additional software by yourself (not provided by the original distribution), you can also install your software here. However, we are still accustomed to placing it in the /usr/local directory.
/proc
– This directory itself is a “virtual filesystem”. The data it places are all in memory, such as system core, process information (process), The status of peripheral devices and network status, etc. Because the data in this directory is all in memory, it does not occupy any hard disk space! If you need to change the kernel parameters, you can change the contents of this directory for system tuning and monitoring.
Recommended learning: Linux video tutorial
The above is the detailed content of What file is tmp in linux?. For more information, please follow other related articles on the PHP Chinese website!