How to: Find real path of symbolic links in Debian/Ubuntu etc.

Last Updated on

e.g. The symbolic link is “/tmp/a.sh” which pointing to the real file “/tmp/test.sh”

1 Launch terminal or connect via SSH

2 Use following command we can see all symbolic links within a directory

ls -ahl /tmp | grep "\->"

Output

lrwxrwxrwx 1 [user] [group] [date] [time] a.sh -> test.sh

3 Alternatively we can use following command to check against single link file

readlink /tmp/a.sh

Output

test.sh

Want to know how to create symbolic/soft links and hard links?

Follow this guide: Quick Linux File Manipulation Commands Reference (and How to: Create Symbolic link/Soft link/Hard link)


Leave a Reply

Your email address will not be published. Required fields are marked *