kilojoules
kilojoules

Reputation: 10083

grep for the character string "--->"

How can I search for file containinng the character string --->?

$ cat arrow
--->
$ grep ---> *
-bash: *: ambiguous redirect
$ grep "--->" *
grep: unrecognized option '--->'
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help` for more information.
$ grep "\-\-\-\>" *
$

Upvotes: 0

Views: 215

Answers (1)

pakistanprogrammerclub
pakistanprogrammerclub

Reputation: 827

Use grep -- to signal end of options

grep -- '--->' *

Upvotes: 4

Related Questions