[CentOS] Strange 'find' misbehaviour
Christoph Neuhaus
nihil14 at gmail.com
Wed Apr 7 07:55:42 UTC 2010
> I just found out something strange. Try it out for yourselves. Here
> goes. Search for any directories under /boot:
>
> # find /boot/ -type d
> /boot/
> /boot/grub
> /boot/lost+found
>
> So far so good. Now execute a detailed listing on the results:
>
> # find /boot/ -type d -exec ls -l \{} \;
>
> ...
>
> Why does 'find' suddenly list everything... and not just the directories?
Nothing strange here. What do you expect from
# ls -l /boot/
Right, you'll see the contents of the directory /boot.
You might be looking for
# find /boot/ -type d -exec ls -ld {} \;
Chris
More information about the CentOS
mailing list