martedì, dicembre 22, 2015

Grep Quick Reference

Basic grep usage



Get lines which does not begin with "#" or ";"?
# grep "^[^#;]" /path/to/my/file 
Search recursively through single file extension
# grep -r --include=<pattern> <string> <directory>
Print two line after and before the match.
# grep -A 2 -B 2 "pattern" /path/to/my/file"

Nessun commento :

Posta un commento