This tutorial is based on Debian 12 alpha1, codename Bookworm. However, this tutorial will work any version of GNU/Linux.
Symbolic links, also known as soft links are file types that points to the location of another directory or file within the filesystem. They are essential files available in any Linux systems. They can allow you to remove the need to type the full path to a given file or directory. They can also allow you to link various tools and services in simple commands.
Method 1 - List all Symbolic Links in Your Filesystem
Let us start at the root level and discuss how we can list all the soft link in the entire filesystem. For that, we can use the
find command in the
To narrow down the search, we need to pass the
type parameter as
-l which denotes soft links.
The command is as provided below:
sudo find / -type l
NOTE: There a lot of soft links in the linux filesystem. Use tools such as
grep to locate files matching a specific pattern.
Method 2 - List All Symbolic Files in the Current Working Directory.
Another method to narrow down your search is to list all the files in your current working directory. For that, you can change the search location for the
find command to the current directory as:
sudo find . -type l
sudo find . type -l
The command lists all the soft links in the
/etc directory as:
Method 3 - List all Symbolic Links in Any Directory
You can also provide an absolute path to a target directory to show the symbolic links. The command syntax is as listed below:
sudo find /path/to/directory -type l
sudo find /var -type l
This tutorial guided you through simple method of listing symbolic links in the entire filesystem, the curent directory, or any target directory without your filesystem.
Leave us a comment down below and share!!