Monday, January 4, 2016

rhel 7 grep command use

`[ashok@private ~]$ cat >dogs
cat
dog
concatenate
dogma
category
educated
[ashok@private ~]$ greo -i cat
bash: greo: command not found...
[ashok@private ~]$ grep -i cat
[ashok@private ~]$ grep -i 'cat'
^C
[ashok@private ~]$ grep -i 'cat' dogs
cat
concatenate
category
educated
[ashok@private ~]$ grep -iv cat dogs
dog
dogma
[ashok@private ~]$ grep -v ^[#] dogs
cat
dog
concatenate
dogma
category
educated
[ashok@private ~]$ grep -e 'cat' -e
]grep: option requires an argument -- 'e'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
[ashok@private ~]$ grep -e 'cat' -e 'dogs' dogs
cat
concatenate
category
educated
[ashok@private ~]$

No comments:

Post a Comment