Linuxtmp file cleanup-general Linux technology-Linux technology and application information. For more information, see. A temporary file (under/tmp) is generated after the system has been used for a long time and needs to be cleared. However, rm-rf is not recommended for cleanup. In this way, the program may be frozen.
We recommend that you use the tmpwatch command for cleanup. Tmpwatch is described as follows:
Name: tmpwatch
Version: 2.8.4
Release No.: 5
GROUP: System Environment/basic source package: tmpwatch-2.8.4-5.src.rpm
Size: 13273 license type: GPL
Abstract: A tool used to delete a file based on the time when the file is accessed.
Introduction:
The tmpwatch tool recursively searches the specified directory and deletes files that are not accessed within the specified period of time. Tmpwatch is generally used to clean directories (for example,/tmp) that are used to temporarily resident files. tmpwatch ignores symbolic links. It does not switch to the file system and only deletes empty directories and regular files.
Note: Execute the tmpwatch command to delete unnecessary temporary files. You can set the file expiration time, measured in hours.
Parameters:
-A or -- all delete any types of files.
-F or -- force forcibly deletes a file or directory. The effect is similar to the "-f" parameter of the rm command.
-Q or -- quiet does not display the instruction execution process.
-V or -- verbose displays the instruction execution process in detail.
-Test is only used for testing and does not really delete files or directories.
Example: sudo/usr/sbin/tmpwatch-afv 3/tmp (clear files not used in the next three hours of/tmp and output the results ).
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.