Ben wrote regarding 'RE: [SLE] YAST RPM storage location' on Thu, Aug 19 at 09:42:
I hope this one makes it to the list!!
On 19/08/04 03:12 PM, Steve Kratz
wrote: Thanks!
By the way-- know of any good CLI "search" programs? I know there's the GUI find, but that doesn't run as root, and didn't let me search for the stash of RPMs...
There are several that do different things. whereis for example looks only for binary files, locate will try and match a string you pass to it, but the most useful is probably find and construct a search query, so "locate rpm | grep yast" will find any rpms within the entire directory structure that have yast in their absoloute path. "find /var -iname rpm" will find anything in /var with rpm in the path. "find /var -iname *.rpm" will find any file ending in rpm in the path.
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. 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.
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...