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?

1 Answer 1

ln -f "$(readlink <symlink>)" <symlink>
  • as a command: function soft_to_hard() { ln -f "$(dirname $1)/$(readlink $1)" $1;}
    – Elazar
    May 29, 2016 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.