Skip to content

Find all symlinks in a Linux or Solaris filesystem⚓︎

Overview⚓︎

Using find we can search a directory structure for all symlinks, including searching only for those which are broken.

Process⚓︎

The below command will show all symlinks, including those in dot directories.

Bash
1
find . -type l -ls

The below command will do similar to above, but only shows symlinks which point to files and directories which no londer exist. This helps in finding, and removing, broken symlinks.

Bash
1
find -L . -type l -ls

References⚓︎