How to find a file that contains the specified string in FreeBSD?
8,220
Did you mean:
grep -rl my_search_pattern my_dir1 my_dir2 my_dir3 my_another_file
Related videos on Youtube
Author by
Cyclone
Updated on September 18, 2022Comments
-
Cyclone almost 2 years
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?
-
Fox over 12 yearsthere aren't many ways that could make searching for string faster, than grep. and if you want to search multiple directories, just list them ...
grep -r string dir1 dir2 dir3
, or just grep the string on the whole drivegrep -r string /
(this could take a long time though and i'm not sure if freebsd grep will dig into devices by default) -
Cyclone over 12 years@RoyceWilliams Good point!
-