Reputation: 32986
I'm trying to use grep to find the string "init()" in all the files that end in .js in a directory.
I tried this
grep "init()" *.js
but it didn't work. Why not? What's the correct way to do this?
Upvotes: 0
Views: 797
Reputation: 19012
Try escaping the parentheses: grep "init\(\)" *.js
It is actually a regular expression, where (
and )
are special characters.
Upvotes: 4