bash print lines that dont have a word 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

Here is what the above code is Doing:
1. The grep command is used to search for a pattern in a file.
2. The -v option inverts the match, so that it prints all lines that do not match the pattern.
3. The pattern is the word “word”
4. The input_file is the file that we are searching through.

Similar Posts