Wednesday, December 21, 2005

unix tip: one-liner find files with different regex

instead of we type find a few times, we can use -o option.
eg:

$ find . -name "*ksh" -o -name "*txt"
./.mozilla/default/nxdv20h2.slt/cookies.txt
./scripts/sham.ksh
./scripts/java.txt
./scripts/ii.ksh
./scripts/aa.ksh
./scripts/input.txt
./scripts/output.txt
./scripts/test.ksh
./scripts/tiktok.ksh
./scripts/file.txt
./download/firefox-installer/license.txt
./sample.txt

No comments: