Grep: Difference between revisions
→One-Liners
Line 47:
Recursive Search
grep -r "test" *
Recursively but ignore binary files
grep -rI "test" someDir/
Invert match
Line 92 ⟶ 95:
Grep from compressed files
zgrep -I "free space" ./messages*
Print lines which begin with "foo" and end in "bar"
grep "^foo.*bar$" file.txt
Filter the Filtered output:
grep "test" file.txt | grep -v "pass"
Search for the string and not the regex:
fgrep "foobar" file.txt
grep -F "foobar" file.txt
<br />
|