search

general syntax of grep:
: grep options search_string file....

In the following cases search for the file "php.ini"

find / -name php.ini          - search the whole computer
find . -name php.ini          - search the current directory
find . -iname bin -type d   - search for directories

ls - LR | grep php.ini        - note that capital L is different from lower case l for ls
locate php.ini                   - uses the database updated by "updatedb"

Text in subfolders:           grep -r Walden ~/Documents/* 
Whole words only: grep -w live 
Case-insensitive text:  grep -i pond 
List File names only:       grep -l Walden 
# of occurrences only:  grep -c Walden 


Comments