In Linux Bash shell,
> grep -B 1 -A 2 test Readme.txt
#-B number to set number lines before the match
#-A number to set number lines after the match
> grep -C 3 test Readme.txt
#-C number to set number lines before & after the match
> grep -B 1 -A 2 test Readme.txt
#-B number to set number lines before the match
#-A number to set number lines after the match
> grep -C 3 test Readme.txt
#-C number to set number lines before & after the match
No comments:
Post a Comment