So let's say I have a symbolic link of a file in my home directory to another file on a different partition. How would I find the target location of the linked file? By this, I mean, let's say I have file2
in /home/user/
; but it's a symbolic link to another file1
. How would I find file1
without manually having to go through each partition/directory to find the file?
Symbolic Links – How to Find the Original File
symlink
Best Answer
Try this :
( last target of your symlink if there's more than one level )
If you just want the next level of symbolic link, use :
Edit 2020:
now, GNU coreutils own
realpath
:similar to
readlink -f
by default