Bug 50490
Summary: | find does not work correctly in certain instances | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | bcling |
Component: | findutils | Assignee: | Tim Waugh <twaugh> |
Status: | CLOSED NOTABUG | QA Contact: | Aaron Brown <abrown> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | CC: | stickster |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-12-07 00:06:01 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
bcling
2001-07-31 17:29:58 UTC
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* /usr/lib/linuxconf/descriptions/eng/samba /usr/lib/linuxconf/descriptions/es/samba 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 intended. Yes, this is a quoting issue. Use: find -name '*.jpg' Closing. |