Home > Article > Operation and Maintenance > Where is the tmp directory in linux
The tmp directory in Linux is usually located in "/tmp" or "/var/tmp" under the root directory. Both directories are used to store temporary files. You can use the following command to view the specific location "echo $TMPDIR".
The operating system of this tutorial: Linux5.18.14 system, Dell G3 computer.
In Linux, the tmp directory is usually located in /tmp or /var/tmp in the root directory. Both directories are used to store temporary files.
/tmp directory is a system-level temporary file directory. It is created when the system starts and is used to store temporary files. These files will be cleared after the system restarts.
/var/tmp directory is also used to store temporary files, but its contents will not be automatically cleared after the system is restarted, so it can be used as a persistent temporary file in some cases. File storage directory.
Most Linux distributions store temporary files in one of these two directories. You can use the following command to view the specific location:
echo $TMPDIR
This command will output the directory path used to store temporary files in the system.
It should be noted that since different Linux distributions and configurations may be different, the location of the temporary file directory may change. Therefore, it is best to confirm based on the actual running system.
The above is the detailed content of Where is the tmp directory in linux. For more information, please follow other related articles on the PHP Chinese website!