I have a symlink to a file on my Ubuntu system, and I need to copy the original file to a different directory and have a new name there. I am able to copy it to a different directory using
readlink -ne my_symlink | xargs -0 cp -t /tmp/
But I am not able to give a new name in the destination directory. Basically, I am looking for a command that could look like:
readlink -ne base.txt | xargs -0 cp -t /tmp/newnametofile
When I try the exact same command above, it gives me file or directory not found error.
Anyway to achieve this?