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 instruction "tmpwatch" to delete directories/Enter the following command to delete files in "tmp" that have not been used for more than one day:
$ tmpwatch 24 /tmp/ #Delete/Files in the tmp directory that have not been used for more than one day
After executing the above commands, the results are 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