All of you should be familiar with find command. I’d like to share some tricks that saved me lots of time in the past.

Find me all config files in /etc folder:

find /etc -name "*.conf"

Same thing, but filter down to files created 5 days ago or less:

find /etc -name "*.conf" -ctime -5

Change permissions to 644 for files only:

find /var/www/ -type f -exec chmod 664 {} /dev/null ;

Show me the files containing the word root in them along with snapshots and line numbers where this word is found:

find /etc -type f -exec grep -ni 'root' {} /dev/null ;

Convert CRLF files to the Unix format:

find ~/download -name "*.txt" -exec dos2unix {} /dev/null ;

Find “dead” links:

find . -type l ! -exec test -r {} ; -print

What find tricks do you use? Did I miss something important here?