Unix & Linux: How do I copy a symbolic link? (2 Solutions!!)
Channel: Roel Van de Paar
Date: 2020-08-12

Unix & Linux: How do I copy a symbolic link?


The Question: I have a symbolic link to a file in one directory. I would like to have that
same link in another directory. How do I copy a symbolic link?
I tried to cp the symbolic link but this copies the file it points to instead
of the symbolic link itself.

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

== This solution helped 2 people ==
Check this answer https://superuser.com/a/315757/53590 for a specifically
CentOS take on the problem. The whole question might help you but the bit at
the bottom is specifically CentOS.

With thanks & praise to God, and with thanks to the many people who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music: https://www.bensound.com/royalty-free-music | Images: https://stocksnap.io/license & others | With thanks to user User (https://unix.stackexchange.com/users/6250), user Simon Hoare (https://unix.stackexchange.com/users/26476), user Jeff Schaller (https://unix.stackexchange.com/users/117549), user Gilles 'SO- stop being evil' (https://unix.stackexchange.com/users/885), and the Stack Exchange Network (http://unix.stackexchange.com/questions/56084). Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything is amiss at Roel D.OT VandePaar A.T gmail.com.