To search the string under the current directory recursively
grep –irl “String” *
–i: case insensitive
–r: search recursively under the directory
–l: Display only the filename
–v: Display the non matching line
Useful for deleting the sentence
–c : count the number of occurrences of the particular sequence.
grep –c “hello” filename.txt
It is working only in the shell script not in the terminal . why I don’t know.
No comments:
Post a Comment