Home >Operation and Maintenance >Linux Operation and Maintenance >Can the tmp directory be deleted in Linux?
In Linux, the tmp directory can be deleted; this directory is used to store temporary files. This directory will clear files that have not been used for a specified number of days by default. The system restart will clear the directory. The "/tmp" directory will be cleared by default. Files that have not been used for 10 days. The "/var/tmp" directory will clear files that have not been used for 30 days by default.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
It can be deleted. /tmp is a temporary folder under Linux.
But generally there is no need to delete it, because 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.
Linux has two well-known temporary directories: /tmp and /var/tmp. These two directories are used by users to store temporary files, and are often read and written by programs to store temporary data.
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 directory clears files that have not been used for 10 days by default. The system restart will clear the directory
/var/tmp directory clears files that have not been used for 30 days by default
Related recommendations : "Linux Video Tutorial"
The above is the detailed content of Can the tmp directory be deleted in Linux?. For more information, please follow other related articles on the PHP Chinese website!