Grep search tip

March 2024

Search for a string in specific files within the current directory and its children, with context lines before and after the term and excluding certain directories.

grep -wirn ${PWD} \
  --include=\*.md \
  -e 'foo bar'    \
  -C3             \
  --exclude-dir=libraries