How to find symbolic links that point to a directory
How to find symbolic links that point to a directory?
Use the find command to find symbolic links and define that the destination type should be a directory.
find . -type l -xtype dThe 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.
Finding symbolic links
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.