Grep Command

Grep Command attributes

Recursively Search a sting in current directory

grep -inr 'search-text' .

Search in specific file pattern

grep -inr --include="*txt" "search-text" .

Grep with only first 150 text of lines

grep -inr 'search-text' | cut -c 1-150

Grep multiple text in a single search

grep -e "search1" -e "search2" file.txt

Leave a Comment