Re: find a file
Mon, 6 Aug 2007 14:44:52 +0200
John Dangler wrote:
> find -name "searchterm" /
> Will search the entire drive for files...
find / -name "searchterm"
because the path needs to precede other options.
> As to the secondary question regarding grep, to find a specific word in
> a file (or files) in a directory, I usually do this little shell
> script, typed at the commandline- for word in `ls`
> cat $word | grep "searchword"
> That will search each file in a directory and tell you which files have
> the word you want (if any)
You can use grep alone:
grep -re "searchword" *
or if you only want to list the filenames:
grep -lre "searchword" *
ubuntu-users mailing list
Modify settings or unsubscribe at: