bash print word from line code example
Example 1: bash print lines that dont have a word
# Basic syntax:
grep -v word input_file
# This prints all lines of the input_file that don't contain "word"
# Note, even lines that contain the substring "word" are removed
Example 2: bash how to print lines after a matching line
# 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)