grep / egrep

Remove comments and display the file

Unix egrep – print file except # comments

egrep -v “^$|^#” kibana.yml

Display the content or pattern matching in file

  • E – egrep as pattern
  • H – File Name
  • n – Line Number
  • w – Whole word as pattern
  • v – invert match

grep -EH ‘multiline’ *.conf

grep -nEH ‘multiline’ *.conf