Linux find Tips&Tricks

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:

1
find /etc -name "*.conf"

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

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

Change permissions to 644 for files only:

1
find /var/www/mycoolblog.com -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:

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

Convert CRLF files to the Unix format:

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

Find “dead” links:

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

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