Странице

Ознаке

четвртак, 4. септембар 2014.

Grep examples

grep "text string to search" directory-path
grep [option] "text string to search" directory-path
grep -r "text string to search" directory-path
grep -r -H "text string to search" directory-path
egrep -R "word-1|word-2" directory-path
egrep -w -R "word-1|word-2" directory-path

 Recursively Search All Files For A String:
cd /path/to/dir
grep -r "word" .
grep -r "string" .
Ignore case distinctions:
grep -ri "word" .
To display print only the filenames with GNU grep, enter:
grep -r -l "foo" .
You can also specify directory name:

grep -r -l "foo" /path/to/dir/*.c

Нема коментара:

Постави коментар

Напомена: Само члан овог блога може да постави коментар.