Command-line Knowledge Base

grep

Find Files Containing Specific String 2
grep -rnw '/path/to/somewhere/' -e 'pattern'
Find Files of a Specific Extension Containing a Specific String 3
grep -rnw . --include \*.php '/path/to/somewhere/' -e 'pattern'
To Grep for Multiple Strings or Patterns — Example 1/3 1
grep 'pattern1\|pattern2' fileName_or_filePath
To Grep for Multiple Strings or Patterns — Example 2/3 1
grep -e extra -e value -e service sample.txt
To Grep for Multiple Strings or Patterns — Example 3/3 1
findmnt -D |grep -e SOURCE -e '^/dev'
NULL