grep [OPTIONEN] MUSTER DATEIEN
# Zählt, wie oft in datei.txt der String "Hallo",
# gefolgt von einer Ziffer, vorkommt
grep -c "Hallo[0-9]" datei.txt
  • -i Case-Ignore
  • -c Count occurrences
  • -r Recursive search (sub-folders)
  • -v Invert search
  • -l Only return Names
  • -n Return every line number