Linux‎ > ‎

find

Linux Find Command

Delete files older than 7 days

find /path/to/files/ -mtime +7 -exec rm {} \;
If require filtering:
find /path/to/files/ -name *file* -mtime +7 -exec rm {} \;

find files sized over 4GB

sudo /usr/bin/find -x / -size +40000000c -exec /bin/ls -lh "{}" \;

command a long list of file with the find command

find . -type f -exec chmod o+w {} \;

find files that are 2 minutes or less old

find . -mmin 2 -print

find files that are older than 2 minutes

find . -mmin +2 -print
Comments