#oEmbed (JSON) oEmbed (XML) IFRAME: about:blank Skip to content Linux TLDR (BUTTON) Menu ____________________ (BUTTON) Menu * 🏠 Home * 🐧 Topic + All in One + DevOps o Ansible o AWS o Docker o Git o Jenkins o Kubernetes + Hardware o Raspberry Pi + How to + Linux Commands o Builtin Commands o Curl Commands o Homebrew Commands o MySQL Commands o SSH Commands + Linux Distributions o Alma Linux o Debian o Fedora o Kali Linux o Linux Mint o Manjaro o Red Hat o Ubuntu + News & Updates + Package Installer + Programming o Bash Scripting o C/C++ o Go Lang o Java o Javascript o Node Js o Php o Python o Ruby + Reviews + Tools + Troubleshooting + Tutorials + Weekly Roundup + What is * 🕵️ Privacy Policy * 📧 Contact Us * 📖 About + 🪶 Write an Article + 🔗 Follow Us + 🎁 Donate 5 Ways to Follow (or Find All) Symbolic Links in Linux Linux TLDR Last Updated: December 18, 2025 No Comments Reading time: 3 minutes Symbolic links (also referred to as “soft links” or “symlinks”) are a kind of shortcut to another file used in the Linux operating system mostly for shared libraries. If you’ve been using Linux as a regular desktop, you might already have encountered one or will in the future. But today’s focus will be on how you can find the original file to which the symbolic link points. Note that we already wrote a separate article for all the tools that are mentioned in this article, so this is kind of a summarized version of all the tools. However, if you directly jump to this article and are only interested in knowing a tool that can help you find the original file to which the symbolic link points, then you can directly read our readlink command article. So, let’s keep all this aside and jump to the main topic: how to follow symbolic links in Linux. Table of Contents Toggle * Tutorial Details * How to Follow Symbolic Links in Linux + Using the ls command + Using the readlink command + Using the realpath command + Using the stat command + Using the file command * Final Tips! Tutorial Details Description Following the Symbolic (or Soft) Links Difficulty Level Low Root or Sudo Privileges No OS Compatibility Ubuntu, Manjaro, Fedora, etc. Prerequisites ls, readlink, realpath, stat, file Internet Required No How to Follow Symbolic Links in Linux As I’ve told you earlier, symbolic links are nothing but a kind of shortcut to another file created using the ln command. Once you create the soft link, there are multiple ways to find the original file to which it points. In Linux, you have multiple commands to do this job, followed by: * ls command (ineffective, not recommended) * readlink command (recommended) * realpath command (identical to readlink) * stat command (provide additional information) * file command (provides information about the file type) So, we will go through each of the above mentioned commands to find the original file to which the soft link points. But before that, check the following image: Soft link structure in my Linux In the above image, there are nested soft links, followed by “file.txt (original file) <- file1.txt (soft link – layer 1) <- file2.txt (soft link – layer 2)” in my Linux system. I will use “file2.txt“, which is on top of the soft link tree, to show you all the examples in this article, so let’s get started with our first command. Using the ls command The ls command is not a specialized tool designed for the purpose of printing the original file to which the soft link points. However, if you use the “-l” flag, then it will give you the path of the file to which the specified soft link points. $ ls -l file2.txt Output: Using the ls command, determine the path to the file to which a soft link points As you can see, it returns “file1.txt” in the output, which is another soft link, so this command is not the perfect solution if the specified soft link involves multiple layers, like one link pointing to another. However, you can check the next command that can dig the soft link in multiple layers to give you the original file. Using the readlink command Readlink is a specialized command-line utility that allows you to follow soft links in a single or multiple layers in the tree. For example, the following command with the “-f” flag will directly return the original file to which all the soft links point. $ readlink -f file2.txt Output: Return the original file to which all soft links point using the readlink command Using the realpath command As its name suggests, it returns the absolute path of the referenced file, directory, or soft link; however, it is quite different from the previous command, which can be stated in this way: this command without any flag is equivalent to the “readlink -f” command. For example, the following command, without any flag, will directly return the original file to which all the nested soft links point. $ realpath file2.txt Output: Returns the original file to which all soft links point using realpath command Using the stat command The stat command is usually used to get detailed information about a referenced file or filesystem, like file size, blocks, IO blocks, device type, etc. You can directly specify the soft link path as an argument to this command, but you should note that it will give you the next mapped link or file path. $ stat file2.txt Output: Using the stat command, return the file to which the soft link points If you just want to know the file to which the soft links point and want to ignore other unnecessary information in the output, then use the following command: $ stat -c%N file2.txt Output: Trimming stat command output Using the file command The file command is mostly used to find the type (or property) of a referenced file, directory, or soft link. In the case of a soft link, it will also print the next mapped link or file path. $ file file2.txt Output: Return the file to which soft link point using file command Final Tips! If you are only interested in knowing the next mapped or original file to which all the soft links point, then I would suggest using the readlink and realpath commands (you can also read our article about them to learn more). So, that’s it for today; if you have any questions or queries related to this topic, then feel free to ask them in the comment section. SHARE: Recommended Articles 🔗How to Install Zabbix Server on Ubuntu 24.04 (Noble Numbat) 🔗Stellar Repair for MySQL – Product Review 🔗How to Install RQuickShare (NearbyShare/QuickShare) on Linux 🔗How to Install RabbitMQ Server on Linux (Quick Guide) 🔗How to Use Chattr Command in Linux (for Beginners) 🔗How to Setup SOCKS5 Proxy Server on Linux Using MicroSocks 🔗Reset the WordPress Admin Password Using CLI (via 2 Methods) 🔗How to Check Python Version in Linux (via 3 Methods) 🔗How to Check PHP Version in Linux (via 4 Methods) 🔗[Fixed] pkg-config script could not be found in Linux Join The Conversation Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy. Cancel reply Comment _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ Name ______________________________ Email ______________________________ [ ] Save my name, email, and website in this browser for the next time I comment. [Don't subscribe_______] Notify me of followup comments via e-mail. You can also subscribe without commenting. Post Comment Latest Install zabbix server on ubuntu How to Install Zabbix Server on Ubuntu 24.04 (Noble Numbat) mysql database recovery tool Stellar Repair for MySQL – Product Review RQuickShare Linux How to Install RQuickShare (NearbyShare/QuickShare) on Linux Install RabbitMQ Server on Linux How to Install RabbitMQ Server on Linux (Quick Guide) chattr command How to Use Chattr Command in Linux (for Beginners) Newsletter Explore the latest Linux news, tutorials, tips, and resources to master open-source technology. Social Handles Your help is needed AI and ad blockers are significantly impacting advertising revenue. Donate now to support funding for this independent site. 🎁 Make a Donation Linux TLDR © 2025 - Discover, Learn, and Master Linux with Us 🐧 x