linux - How to do it correctly: grep -ri '->' -
cat a.txt | grep -ri '->'
i want grep lines text arrow ->. in linux shell -
means starts of option
, >
means pipe output file.
so after doing command given above ,i got error
[root@rs169 document_root]# cat a.txt | grep -ri '->' grep: invalid option -- '>' usage: grep [option]... pattern [file]... try `grep --help' more information.
can tell how correctly?
another way of doing use --
- tells grep have finished using flags, , -
appearing after interpreted literally.
$ echo "->" | grep -- "->" ->
Comments
Post a Comment