If you use Unix, master find and xargs. No ifs, ands, or buts. Do it now.
Find all files that don’t end with a *.c
$ find . -not -name '*.c'
Find all files that don’t end with a *.c or . or .bin
$ find . not \( -name '*.c' -o -name '.' -o -name '*.bin' \)
Search all files that end with *.rb for cranium
$ find . -name "*.rb" | xargs grep -n "cranium"
Add a bunch of files to subversion. Files not added to Subversion are marked with a ?
$ svn st | grep "^?" | awk '{print $2'} | xargs svn add
Delete files not ending in *.rb
$ find ./app/models -not \( -name '*.rb' \) | xargs rm -rf
Kill all processes with the identifier mysql
$ ps aux | grep mysql | awk '{print $2}' | xargs kill -9
Scour your computer for *.jpg files and copy them to the current directory
$ find . -type f -name *.jpg -exec cp {} . \;
Find files with spaces in their name
$ find . -name "[Bb]log Posts*" -print0 | xargs -0 grep -n "lolcats"
Finding (vulgar) words in a working copy of your source code. Substitute “foo” and “bar” for your words
$ svn st | grep "^[MA]" | awk '{print $2}' | xargs grep -E "foo|bar"
Execute a command for item provided by a pipe. find . -name "*.html" will return a list of files. xargs -L 1 says to place them on their own line
$ find . -name "*.html" | xargs -L 1 wc
Also on the internets: http://dmiessler.com/study/find/ and Learn 10 good UNIX usage habits