Use Grep And Regular Expressions To Analyze Text

General Information

Pattern matching with grep.


Filter lines that start with (^) a comment (#) in myfile.txt

grep "^#" myfile.txt


Filter for “auth”, ignore case

grep -i "auth" /etc/ssh/ssh_config


Common Grep Options


Regular Expression Matching