cheat sheets.

$ cheat find
To search the entire filesystem for a specific file:
$ find / -name "rc.conf" -print

To search current directory and sub directories for a specific file:
$ find . -name "rc.conf" -print

To execute a command on every file/dir
$ find [expression..] -exec [command..] '{}' \;

Example: find all files/dirs named CVS and delete them:
$ find -name CVS -exec rm -Rf '{}' \;

Example: find all files containing a string:
$ find * -exec grep -l '<string>' {} \;

To search only on the given directory:
$ find [directory..] -maxdepth 1

Example: find all directories modified in the past day and permission 755:
$ find . -type d -mtime 1 -perm 755

Example: find and fix all files that have permission o+w:
$ find -type f -perm /002 -exec chmod o-w '{}' \;
Version 7, updated 182 days ago.
. o 0 ( edit | previous | history | diff )
( add new | see all )