Skip to content

Instantly share code, notes, and snippets.

@mickambar19
Created June 13, 2023 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickambar19/30b7cbba4d13904cf32a717c2d3f823c to your computer and use it in GitHub Desktop.
Save mickambar19/30b7cbba4d13904cf32a717c2d3f823c to your computer and use it in GitHub Desktop.
Command Line
# Get lines of a file where a term is not found
# TERMS_FILE_NAME - The terms to search
# TARGET_FILE_NAME - File to exract the lines without a term matching
#
# `-v`: Inverse search, display lines that do not match the pattern.
# `-o`: Display only the matched patterns.
# `-w`: Match whole words only.
# `-n`: Display the line number of each match.
# `-f`: Read patterns from a file.
grep -o -E '\w+' TERMS_FILE_NAME | sort -u | grep -vnf - TARGET_FILE_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment