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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -