find a file

John Dangler jdangler at terremark.com
Mon Aug 6 12:12:16 UTC 2007


find -name "searchterm" /
Will search the entire drive for files...

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`
do
cat $word | grep "searchword"
done

That will search each file in a directory and tell you which files have the word you want (if any)

I wouldn't recommend this for extremely large directories (or an entire disk).


----- Original Message -----
From: ubuntu-users-bounces at lists.ubuntu.com <ubuntu-users-bounces at lists.ubuntu.com>
To: Ubuntu user technical support,  not for general discussions <ubuntu-users at lists.ubuntu.com>
Sent: Mon Aug 06 07:21:46 2007
Subject: Re: find a file

On 8/6/07, norman <norman at littletank.org> wrote:

	Although I have used Ubuntu for quite some time I have never been sure
	how to go about finding named files. I am not a Linux person although, I
	can use a terminal if needed. For example I needed to find any files
	with .lck as the extension and remove them otherwise I would be unable
	to burn DVDs using Mthtv. So, I went to Places -> Search for files,
	entered *.lck and the report was no files found. Yet there had to be at
	least one file which was causing me the problem. 


That's one problem I have too. Sometimes I find things using the "locate -R" command, but sometimes it doesn't work. I still haven't learned how to search things on linux. 
I have also looked on man and google about how to use the grep command, but still haven't figured out how to find things this way. A couple of days ago, I wanted to find all the files containing a specific word, but couldn't figure out how to use the grep command. =(

Allan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070806/1789e936/attachment.html>


More information about the ubuntu-users mailing list