Answers for "grep show 5 lines before and after"

1

grep find and show lines after

# Use the -A flag.
# Example: 
iptables -L | grep FORWARD -A 10
Posted by: Guest on September-30-2021
1

grep 10 line before

Include -A flag to add lines after match and -B flag to add lines before
grep match -A 3	#display match line and 3 after lines
grep match -B 2 #display match line and 2 lines before
Posted by: Guest on November-26-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language