Out of curiosity i wanted to open a symlink as itself instead of the file it points to, just to see how it looks like. While there are ways to see what file it points to like using readlink
and ways to copy symlinks themselves like cp -P
, none of these allow you to see the actual contents of the symlink.
Is there a simple way to accomplish this? (either in plain text or in hexadecimal)
readlink
reads the actual contents of the symlink. A symlink doesn't necessarily point to a file; it can be dangling.readlink
will read whatever is in it. – Kaz Aug 24 '21 at 23:24