LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   find path and trailing "/" (http://www.linuxquestions.org/questions/debian-26/find-path-and-trailing-625669/)

kaz2100 03-04-2008 12:48 PM

find path and trailing "/"
 
Hya,

My Debian lenny, (I do not know when it started)
Code:

find /usr -name fileToFind -print
does not work, while
Code:

find /usr/ -name fileToFind -print
works.

I checked MacOSX and Solaris, and both forms work. (MacOSX returns like
Code:

>find /usr/ -name find -print
/usr//bin/find
>

)

At this moment, I do not have access to other Linux.

Is trailing "/" required in POSIX?

I appreciate any comments.

Happy Penguins!

forrestt 03-04-2008 12:55 PM

Look at the output of "ls -lad /usr". If it is a link (begins with lrwxrwxrwx) then your first find is treating like a file, and goes no further while the second treats it like a directory and continues. If the output of the above ls command is a directory (begins w/ drwxr...), then it will need more investigation.

HTH

Forrest

kaz2100 03-04-2008 03:10 PM

Hya

Thanks forrestt: /usr is a directory, not a link. Need more investigation....

Happy Penguins!

forrestt 03-04-2008 03:33 PM

OK, found it. There was a bug in find. It was fixed in late November 2007.
Here is the bug report:

http://savannah.gnu.org/bugs/index.php?20970

If you update findutils, this should go away.

HTH

Forrest


All times are GMT -5. The time now is 08:53 AM.