Home >Operation and Maintenance >Linux Operation and Maintenance >Can the tmp directory be deleted in Linux?

Can the tmp directory be deleted in Linux?

WBOY
WBOYOriginal
2022-03-21 11:38:5212481browse

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.

Can the tmp directory be deleted in Linux?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Can the tmp directory be deleted in Linux?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn