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 Note some of the idiosyncracies of "locate": % locate /home |wc -l 14402 % locate /home/ |wc -l 13982 % locate '/home/*' |wc -l 5372
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*'". And if you really want to get hard-core about it, find will allow you to use full-blown regular expression instead of the default shell glob patterns used with the "-name" and "-iname" predicates. To use this capability, use "-regexp" or "-iregexp" in place of "-name" and "-iname". Note, too, that find can restrict output to certain classes of file system entity using the "-type X" option. The two I use most often are "-type f", which shows only plain files and "-type d" which shows only directories. Find is very powerful. A bit of studying of the man page will be rewarded.
There are no real all in one tools within *nix (excluding emacs), instead the OS provides the tools to string together various programs that allow you todo the work of them.
Do one thing, and do it well (and support STDIN/STDOUT, please)... :)
--Danny, who should probably do some actual work this morning...
Randall Schulz