« Back to File systems: Frequently Asked Questions

How to find symbolic links that point to a directory

The find command has so many options, that it may be overwhelming to learn all it has to offer. Let’s have a look at this particular question.

The obvious way to find a symbolic link is define -typel. This will search and show all symbolic links. To find all symbolic links that point to a directory, use find with the -type l and combine it with the -xtyped options.

find . -type l -xtype d

To search in a specific directory, replace the dot with the directory to start.

Learn more about find

This article uses the find command to achieve its tasks. For this popular tool there is a cheat sheet available!

» Mastering the tool: find

find cheat sheet

Other questions related to Linux file systems

Feedback

Is the described answer not working or incorrect, got another tip or question? Share your thoughts!