How to find files in linux
Need to find files older than certain time frame? This will help, “find [dir] -type f -mtime +[24hours*n] ”
Examples,
Show files older than 7 days
find /tmp/ -type f -mtime +7
Show files older than 7 days and rm them.
find /tmp/ -type f -mtime +7 -exec rm {} \;
or if you have a large number of files
find /tmp/ -type f -mtime +7 | xargs rm
Tags: bash script, command line, commands, HowTo, Linux




















hongkiat | January 16th, 2008 at 1:34 pm #
Nice little tricks, saving them to my routine use list
josh | June 11th, 2008 at 3:17 pm #
.
Search for files on Linux quickly using the command line:
article:
http://www.codetechnical.com/linux/search-for-a-file-in-linux.html
.