Home · Latest · Trends  /  general
0

Grep command to display line containing the variable along with lines before and after options

rated 0 times [  0] [ 0]  / comments: 1 / hits: 272  / 1 year ago, wed, feb 21, 2018, 15:16:03
Grep command to display line containing the variable along with lines before and after options - Example: I have a file containing numbers 1 - 9 each in newline. I am trying grep for value 5 and want to display 5, 3 entries after and 2 entries before the occurance of 5
cat gp | grep -A 3 -B 2 5
3
4
5
6
7
8
More From » general
 

Comments

0
14.I’m so lucky to own discovered this site page. You practically stated me just what I opted to listen to and then some. Beautiful publishing and cheers again for accomplishing this no toll! air duct cleaning Miami
[#87] Wednesday, June 19, 2019, 23:49:43
 
joshuaprice153
commented 11 hours ago
Only authorized users can post. Please sign in first, or register a free account
 
Share
Sponsor
Posted
vishymac

vishymac

Member since Feb 23, 2017
Total Code Snippets: 6
Total Comments: 0
Location: Philadelphia
Following
User not following anyone yet.
vishymac snippets
2 yaers ago, fri, jul 21, 2017
2 yaers ago, fri, jul 21, 2017
1 year ago, mon, feb 19, 2018
8 months ago, mon, oct 29, 2018