Re: Strange 'find' result
On Tue, Feb 16, 1999 at 05:31:22PM +0200, Johann Spies wrote:
> On Mon, 15 Feb 1999, Mitch Blevins wrote:
>
> > In foo.debian-user, you wrote:
> > > Can somebody explain this to me?
> > >
> > > $ find /cdrom -iname wx*
> > > $ find /cdrom -iname wxx*
> > > /cdrom/debian/hamm/hamm/binary-i386/libs/wxxt1_1.66d-2.deb
> > >
> > > Why does the first 'find' query give no results?
> >
> > Are you quoting the argument to avoid shell expansion?
> >
> > $ find /cdrom -iname 'wx*'
>
> No. I just did it as it was printed above.
>
> Today is another day. I did the same thing and here is the result:
> (I was in my home directory as I was yesterday)
>
> jhspies@Johann(8)$ find /cdrom -iname wx*
> find: paths must precede expression
> Usage: find [path...] [expression]
> jhspies@Johann(9)$ cd /
> jhspies@Johann(10)$ find /cdrom -iname wx*
> /cdrom/debian/hamm/hamm/binary-i386/doc/wxhelp_1.66d-2.deb
> /cdrom/debian/hamm/hamm/binary-i386/libs/wxxt1_1.66d-2.deb
>
> Anyhow, it is not a problem for me. I was just curious on why the strange
> result. Now I am wondering why I did not get the same result today?
Eh, note that find does special optimization which does not work on CD
ROM's. It assumes that two directories are "." and "..". From the info page:
- Option: -noleaf
Do not optimize by assuming that directories contain 2 fewer
subdirectories than their hard link count. This option is needed
when searching filesystems that do not follow the Unix
directory-link convention, such as CD-ROM or MS-DOS filesystems or
AFS volume mount points. Each directory on a normal Unix
filesystem has at least 2 hard links: its name and its `.' entry.
Additionally, its subdirectories (if any) each have a `..' entry
linked to that directory. When `find' is examining a directory,
after it has statted 2 fewer subdirectories than the directory's
link count, it knows that the rest of the entries in the directory
are non-directories ("leaf" files in the directory tree). If only
the files' names need to be examined, there is no need to stat
them; this gives a significant increase in search speed.
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org finger brinkmd@
Marcus Brinkmann GNU http://www.gnu.org master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de for public PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ PGP Key ID 36E7CD09
Reply to: