DEV Community

loading...

When find can't find

foursixnine profile image Santiago Zarate Originally published at foursixnine.io on ・1 min read

If you happen to be using gnu find in the deadly combination with a directory that is a symlink (you just don’t know that yet), you will find face the hard truth that running:

find /path/to/directory -type f

Will return zero, nada , nichts, meiyou , which is annoying.

where is it!

this will make you question your life decisions, and your knowledge on tools that you use daily, only to find out that the directory is actually a symlink :).

So next time you find yourself using find and it returns nothing, but you are sure that your syntax is correct and get no errors, try adding the --fowllow or use the -L

find -L /path/to/directory/with/symlink -type f

This will do what you want :)

Here is it!

Discussion

pic
Editor guide