My Favorite ‘find’ Command Uses

Find files edited within the last 10 minutes, good for when you install something or update something to see what changed.

find / -mmin -10

Find files last modified older than 2 years ago. Good for cleaning out old files.

find / -mtime +730 -print

Find files modified more than 2 years ago and delete them.  Good for cleaning your system.

find / -mtime +730 -exec rm -fr {} \;

Find files larger than 50MB, useful for cleaning up HD space.

find / -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Rate This Article:
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...

Leave a Comment

You must be logged in to post a comment.