Linux Comm Tmpwatch
# Linux tmpwatch Command
[ Linux Command Reference](#)
The Linux tmpwatch command is used to delete temporary files.
Executing the tmpwatch command can delete unnecessary temporary files. You can set the file expiration time, with the unit calculated in hours.
### Syntax
tmpwatch [directory...]
**Parameters**:
* -a or --all Delete any type of file.
* -f or --force Force delete files or directories, similar to the "-f" parameter of the rm command.
* -q or --quiet Do not display the command execution process.
* -v or --verbose Display the command execution process in detail.
* -test For testing only, does not actually delete files or directories.
### Example
Use the "tmpwatch" command 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 to administrative privileges is as follows:
$ su #Switch to root user Password: ********** #Enter user password
[ Linux Command Reference](#)
YouTip