VVDQ : pine??

mascarasnake dontdrill at earthlink.net
Sun Dec 19 09:32:01 MST 2004


Hey Derick -

 From what I've been able to glean, 'locate' will find files matching 
the search criteria by looking into a file created by 'updatedb' while 
'find' is an interactive search process.

'updatedb' runs as a daily con job (I think - it is on both of my linux 
boxes-but I can't remember if that was stock, or if I modified that) and 
produces a text file that would be similar to:
	ls -R / > file.log
(don't ask me the actual file - I ain't lookin' it up right now).

'find' is actually interactive with the system and can be used in 
scripts kinda like this nifty rename script I found and modified a bit:
	find <directory>/ -iname "<pattern1>" -exec echo "mv '{}' '{}'" \; | 
sed 's/<pattern1>/<pattern2>/2' | /bin/sh

So basically 'locate' looks in a text file and is a kinda glorified:
	ls -R / > logfile; cat logfile | grep <searchquery>
except it will give you full pathnames. Since it relies on the file 
created by 'updatedb', it won't find a file created since the last 
'updatedb'

'find' works interactively with the system and can find the file you 
just created. It can also be piped to other commands/scripts a lot 
easier than 'locate'.

That's the simple explain - the man pages actually give more in depth 
tags and all that good stuff


Derick Centeno wrote:

> I'm tempted to get into an analysis of what locate does versus what find
> does. 

-- 
     It's what you make it man
     Takes time
     A little bit
     A little bit more

             -The Minutemen

dontdrill at earthlink.net


More information about the yellowdog-general mailing list