Skip to content

Instantly share code, notes, and snippets.

@boxfrommars
Created December 14, 2011 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxfrommars/1476665 to your computer and use it in GitHub Desktop.
Save boxfrommars/1476665 to your computer and use it in GitHub Desktop.
# This command will search in the current directory and all sub directories for a file named rc.conf.
find . -name "rc.conf" -print
# This command will search in the current directory and all sub directories. All files named rc.conf will be processed by the chmod -o+r command. The argument '{}' inserts each found file into the chmod command line. The \; argument indicates the exec command line has ended.
find . -name "rc.conf" -exec chmod o+r '{}' \;
# This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.
find . -exec grep "www.athabasca" '{}' \; -print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment