Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 50490 - find does not work correctly in certain instances
find does not work correctly in certain instances
Product: Red Hat Linux
Classification: Retired
Component: findutils (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-07-31 13:29 EDT by bcling
Modified: 2007-04-18 12:35 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-06 19:06:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description bcling 2001-07-31 13:29:58 EDT
Description of problem:
find . -name *.<some extension> does not always work.

How reproducible:

Steps to Reproduce:
1. find . -name *.jpg
2. ls *.jpg
3. cd ..
4. find . -name *.jpg

Actual Results:  find erratically produces results, depending on what the
current directory is.

Expected Results:  Should have returned the .jpg file listed in all

Additional info:

[root@localhost bcling]# ls *.jpg
[root@localhost bcling]# find . -name *.jpg
find: paths must precede expression
Usage: find [path...] [expression]
[root@localhost bcling]# pwd
[root@localhost bcling]# find . -name *.jpg

<and lots of files in the /home/bcling/.netscape directory>

Rawhide is also affected.
Comment 1 Karl schmidt 2001-08-19 00:33:22 EDT
I can confirm that find acts buggy.  The question is whether it is find or the
file systtem.  Both Gnome and KDE file directories seem to have trouble when
files are moved keepin an acurate display.?

That beeing said the errors returned by find make no sence and should be fixed. 

Here is a capture of find failing to work as advertized - the fix was to move to
the root directory?
This really ought to be fixed as it is a core comand to the CLI. 

[root@malaysia src]# find /usr -name samba*
find: paths must precede expression
Usage: find [path...] [expression]
[root@malaysia src]# find /usr/ -name samba*
find: paths must precede expression
Usage: find [path...] [expression]
[root@malaysia src]# cd /
[root@malaysia /]# find /usr/ -name samba*
Comment 2 Paul W. Frields 2001-08-31 08:28:11 EDT
The problem may actually be a syntax error.  Using the command

  find . -name *.jpg

causes the SHELL to match the *, not the find command. Therefore, in the 
submitter's example, while in the /home/bcling directory, the find command is 
evaluated by the shell to become:

  find . -name 2001_07_03_094633_shot.jpg

This will only find the single file resident in the current directory, 
obviously.  While in the / directory, the * evaluates to nothing if there are 
no actual "*.jpg" files in the / directory itself, thus the error (even if the 
error message itself is a little misdirecting).

The proper way to use find would be in this fashion:

  find . -name "*.jpg"

The double-quotes protect the * from being evaluated by the shell; rather the 
entire "*.jpg" argument is passed to the -name option of find, which is what is 
Comment 3 Tim Waugh 2001-12-07 08:54:54 EST
Yes, this is a quoting issue.  Use:

 find -name '*.jpg'


Note You need to log in before you can comment on or make changes to this bug.