Randall wrote regarding 'Re: [SLE] YAST RPM storage location' on Thu, Aug 19 at 10:52:
Danny,
On Thursday 19 August 2004 08:05, Danny Sauer wrote:
Ben wrote regarding 'RE: [SLE] YAST RPM storage location' on Thu, Aug 19 at 09:42:
...
It's probably worth noting that locate will find files *in the parts of the filesystem that are indexed*, which usually excludes a few parts like /home, some parts of /var, etc. When it works, locate is much faster. When it doesn't work, you need to know that it's not actually searching the *whole* system like "find /" as root will.
On my SuSE 9.1 Pro installation, the configuration for building "locatedb" (the database used by the "locate" command) definitely _in_cludes "/home":
% locate /home |egrep '^/home/' |wc -l 5372
Ok, it was just an example - /home is excluded on several of my machines since it's NFS mounted. :) Default locate on 9.1 doesn't include these dirs: UPDATEDB_PRUNEPATHS="/mnt /cdrom /tmp /usr/tmp /var/tmp /var/spool /proc /media" and it only inlcudes those that can be read by the user "nobody." The difference between locate /home and locate /home/ is weird, though. I wish locate would accept regexps, though. I end up piping it through egrep more often than not...
It's also worth noting that "find /var -iname rpm" will find anything in /var that's case-insensitvely named rpm (RPM, rPm, etc). File.rpm will not be found, nor will arpme.txt. :) "find /var -iname '*rpm*'" will.
I think you must have meant "find /var -iname '*rpm*'".
That's what I typed, isn't it? The first command, from someone else's email, will find files whose exact name is rpm, ignoring case sensetivity. The second example is exactly what you typed, unless my char set's off. :)
Find is very powerful. A bit of studying of the man page will be rewarded.
I find myself using the -exec option often, personally. It's great for fixing permissions and removing backup files, among others... --Danny