Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Linux/Copy A Symbolic Link

November 27, 2020

Copy A Symbolic Link

Here’s how to copy a symbolic link which is also known as a soft link from one directory to another. A regular copy command will not work. You will need to use the -P option to copy the symbolic link from one directory to another. If omitted, the symbolic links will not be copied.

cp -P /directory1/* /directory2/

cp -P /directory1/* /directory2/

How to create a symbolic link.

ln -s sourcefile myfile
ln -s /path/to/file myfile

ln -s sourcefile myfile ln -s /path/to/file myfile

Here are the man pages for ln and for cp.

Filed Under: Linux Tagged With: copy, cp, create, link, ln, symbolic

Sign up

Get content delivered to your mail!

About Me

I'm Ulysses, a Cloud Engineer at Cardinal Health based in Columbus, Ohio. I’m a certified AWS Solutions Architect. This website is my way of documenting the things I've learned about the Cloud. When off the grid, I enjoy riding my electric skateboard. I've surfed, snowboarded and played saxophone in the past. I hope you find this site helpful. It's powered by WordPress and hosted in AWS.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021