English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux tmpwatch command is used to delete temporary files.
Executing the tmpwatch command can delete unnecessary temporary files. You can set the file expiry time, which is calculated in hours.
tmpwatch [-afqv][--test][Expiry Time][Directory...]
Parameters:
Use the command "tmpwatch" to delete directories/To delete files in the "tmp" directory that have not been used for more than one day, enter the following command:
$ tmpwatch 24 /tmp/ #Delete/Files in the tmp directory that have not been used for more than one day
After executing the above command, the result is as follows:
removing directctmp/orbit-tom if not empty
Note: This command requires root privileges, so you should use the su command to switch users before using the tmpwatch command. The operation to switch management privileges is as follows:
$ su #Switch to root user Password:********** #Enter user password