[rm] Delete Files older than 5 days on Linux
find /home/rober/CVScode/ -mtime +5 -type f | xargs rm -rf
-daystart
Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and
-mtime) from the beginning of today rather than from 24 hours
ago. This option only affects tests which appear later on the
command line.
-type c
File is of type c:
b block (buffered) special
c character (unbuffered) special
d directory
p named pipe (FIFO)
f regular file
l symbolic link; this is never true if the -L option or the
-follow option is in effect, unless the symbolic link is
broken. If you want to search for symbolic links when -L
is in effect, use -xtype.
s socket
D door (Solaris)
Reference :
Delete Files Older Than x Days on Linux
Unix/Linux find and sort by date modified
Delete files returned by ls
0 意見:
張貼留言