Freebsd – How to find a file that contains the specified string in FreeBSD

freebsdgrepsearchstringsunix-shell

I'm searching for the way to find a file that contains specified string text.

It should be fast as possible but its not that important.

I was reading the manual, and I've build something like that: grep my_string * -r and it works at all, but if there are many directories to search.

Are there any other ways to find a file that contains specified string in FreeBSD?

Best Answer

Did you mean:

grep -rl my_search_pattern    my_dir1 my_dir2 my_dir3 my_another_file