|
Last updated: 05/21/2012
Here are some unix find command examples to for finding and excluding files, running commands, etc.
1. Find files and exclude a directory (./products):
find . -path ./products -prune -o -print
2. Run results through grep (for "JR"):
find . -path ./products -prune -o -exec grep -l 'JR' {} \;
3. Choose just a few directories to search (for all php
files):
find adm cgi-bin -name "*.php
" -print
4. Find files in two directories (adm, cgi-bin) but remove all files with a specific extension (.txt)
find adm cgi-bin -print | grep -v ".txt"
blog comments powered by
|