Linux - grep usage
recursive grep
$ grep -R "192.168.1.1" *
ignore word case grep
$ grep -i "car" /etc/passwd
(i.e. including car, CAR, Car...)
search words only
$ grep -w "car" /path/to/file
(i.e. match only car word)
exclude grep
$ grep -v car /path/to/file
$ grep -R "192.168.1.1" *
ignore word case grep
$ grep -i "car" /etc/passwd
(i.e. including car, CAR, Car...)
search words only
$ grep -w "car" /path/to/file
(i.e. match only car word)
exclude grep
$ grep -v car /path/to/file
Comments
Post a Comment