How to replace a symbolic link with an equivalent hard link

command linefileshard linklnsymlink

Having a (single, no batch filesystem processing needed) symlink, what a command line to use to turn it into a hard link to the same file?

Best Answer

ln -f "$(readlink <symlink>)" <symlink>
Related Question