O'Reilly logo

Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition by Paul Hudson, Andrew Hudson, Matthew Helmke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Copying Files Using cp

To copy files, we could use the cp command. The general format of the command when used for simple copying is as follows:

matthew@seymour:~$ cp -a source_directory target_directory

The -a argument is the same as giving -dpR, which would be

Image -d—Preserves symbolic links (by not dereferencing them) and copies the files that they point to instead of copying the links.

Image -pPreserves all file attributes if possible. (File ownership might interfere.)

-RCopies directories recursively.

The cp command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required