I’m attempting to copy a symlink of a file in one directory to another directory.
I need the copy to be a symlink, not a hard link or a broken symlink.
cp -A and cp -P generated broken (flashing) symlinks as indicated by file -b <copied_symlink_file_name>.
cp and cp -R create hard links.
How would I create a copy of the symlink without resorting to ln -s and creating a new symlink from the original file (therefore requiring knowledge of its inode)?
Thanks for your help.
cp -Pwill work as long as the original symlink created is a absolute symlink to the source rather than a relative one.ln -s destination $(realpath source-file).ln -s $(realpath source) destination