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: 2 / hits: 350  / 2 yaers 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 4 months ago
0
I’ve been visiting your blog for a while now and I always find a great command like this... game mobile legend
[#129] Tuesday, July 9, 2019, 08:08:33
 
patsm00re18
commented 4 months 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: 7
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
2 yaers ago, mon, feb 19, 2018
1 year ago, mon, oct 29, 2018
3 months ago, thu, jul 18, 2019