# Show lines containing any one of multiple keywords in a file 'foo.txt'
grep -e keyword1 -e keyword2 foo.txtgrep keyword foo.txt
# Full (case sensitive) match
grep -w "
# Show X lines before and Y lines after the line containing 'keyword' in a file 'foo.txt'
grep -B X -A Y keyword foo.txt
grep -C Z keyword foo.txt #when Z=Y=X
# Special characters.
grep '\$' # dollar sign
grep -P 'Modified\t' * # Tab
# Special characters.
grep '\$' # dollar sign
grep -P 'Modified\t' * # Tab
沒有留言:
張貼留言