alex
2
Q:

bash print n lines after match

# Basic syntax:
grep 'word1\|word2\|word3' /path/to/file
# This prints all lines that match word1, word2, OR, word3
1
# Basic syntax:
grep -A number word_to_match input_file
# This prints "number" number of lines after and including the first
# line that matches word_to_match in the input_file

# Note, the word_to_match can be any expression that grep uses for 
# 	identifying matches (e.g. including combinations of AND and OR, etc) 
1

New to Communities?

Join the community