Monday, January 05, 2004

How to use the Unix find command
(the syntax of this always flummoxes me...)

Basic syntax:
find
it will search recursively from

1. Search for files with name patterns:
find . -name "*.js"
(search down from current directory for all .js files)

2. How to search for strings in files:
find . -exec grep "javascript" '{}' \;
(searches for all matches on javascript)
(notice escaping of semicolon and generally weird format of command