Mailinglist Archive: opensuse (4547 mails)

< Previous Next >
Re: [SLE] Is there a "find file on system" command?
  • From: Sid Boyce <sboyce@xxxxxxxxxxxxxxxx>
  • Date: Mon, 17 May 2004 16:37:54 +0100
  • Message-id: <40A8DC52.3080706@xxxxxxxxxxxxxxxx>
Robert Paulsen wrote:

On Monday 17 May 2004 03:43, Jerome Lyles wrote:

On Friday 14 May 2004 03:06 pm, Rob Freeman wrote:

I have never been able to find such a program on Linux.

I always:

su
find directory -name filename

hence to search the entire computer for all rpm's

find / -name *.rpm

Need to be root

Rob

su

Password:
# find / -name *.rpm
find: paths must precede expression
Usage: find [path...] [expression]
#

What happened? Isn't '/' enough path for this command?
Thanks,
Jerome


You need to put quotes around the expression you are looking for if it contains special characters that the shell will act on (in your case the *). Try this...

find / -name "*.rpm"

You want the find command to see the *, not the shell.


barrabas:/ftp/apr04/cdrtools-2.01 # time find /usr -name 3Ddiag* -print0
/usr/bin/3Ddiag.runtime/usr/bin/3Ddiag.nvidia_glx/usr/bin/3Ddiag-result/usr/bin/3Ddiag.devel/usr/bin/3Ddiag/usr/bin/3Ddiag.ignoredb/usr/bin/3Ddiag.dri
real 2m44.757s
user 0m0.680s
sys 0m8.060s
Time enough to make that cup of cofee.

barrabas:/ftp/apr04/cdrtools-2.01 # time locate 3Ddiag
/data1/SZB50/usr/bin/3Ddiag
/data1/SZB50/usr/bin/3Ddiag-result
/data1/SZB50/usr/bin/3Ddiag.devel
/data1/SZB50/usr/bin/3Ddiag.dri
/data1/SZB50/usr/bin/3Ddiag.ignoredb
/data1/SZB50/usr/bin/3Ddiag.mesaglide
/data1/SZB50/usr/bin/3Ddiag.mesasoft
/data1/SZB50/usr/bin/3Ddiag.nvidia_glx
/data1/SZB50/usr/bin/3Ddiag.runtime
/data1/SZB50/usr/bin/3Ddiag.sh
/data1/usr/bin/3Ddiag
/data1/usr/bin/3Ddiag-result
/data1/usr/bin/3Ddiag.devel
/data1/usr/bin/3Ddiag.dri
/data1/usr/bin/3Ddiag.ignoredb
/data1/usr/bin/3Ddiag.nvidia_glx
/data1/usr/bin/3Ddiag.runtime
/data1/var/tmp/3ddiag-0.703-build/usr/bin/3Ddiag
/data1/var/tmp/3ddiag-0.703-build/usr/bin/3Ddiag-result
/data1/var/tmp/3ddiag-0.703-build/usr/bin/3Ddiag.devel
/data1/var/tmp/3ddiag-0.703-build/usr/bin/3Ddiag.dri
/data1/var/tmp/3ddiag-0.703-build/usr/bin/3Ddiag.ignoredb
/data1/var/tmp/3ddiag-0.703-build/usr/bin/3Ddiag.nvidia_glx
/data1/var/tmp/3ddiag-0.703-build/usr/bin/3Ddiag.runtime
/usr/bin/3Ddiag
/usr/bin/3Ddiag-result
/usr/bin/3Ddiag.devel
/usr/bin/3Ddiag.dri
/usr/bin/3Ddiag.ignoredb
/usr/bin/3Ddiag.nvidia_glx
/usr/bin/3Ddiag.runtime

real 0m2.311s
user 0m1.460s
sys 0m0.046s

On a XP2800+ 512MB, that was. With "locate -i" it will ignore case.
Regards
Sid.

--
Sid Boyce .... Hamradio G3VBV and keen Flyer
Linux Only Shop.


< Previous Next >