Today I needed to use the ‘find’ command on /tmp, from outside /tmp:

find /tmp -name “foobar*”

It failed, even though I know there are lots of ‘foobar’ files there. A quick web browse found the answer: Because the /tmp dir is a link to another dir (/private/tmp), you have to “search different.” From the linked page, I used:

find -H /tmp -name “foobar*”

And that worked as expected. There are a few other options listed on the page.

https://unix.stackexchange.com/questions/334908/why-doesnt-find-command-find-the-directory-when-run-from

#macOS #macOSTerminal #Geeky

Why doesn't find command find the directory when run from ~?

There is a directory under /tmp with the name test_copy. $ ls /tmp/test_copy/ a.sh b.sh $ cd /tmp /tmp$ find . -name test_copy ./test_copy But if I run the following find command it does...

Unix & Linux Stack Exchange