copy all files and directory into another location in unix

Q. How to copy all files and directory into another location in unix/ linux/ centos

We can copy the contents of a directory /source to another existing directory (folder)  /destination with the help of CP command

cp -a /source/. /dest/

# cp -a /SourceTest/ ./DestinationTest/

 

The -a option is an improved recursive option, that preserve all file attributes, and also preserve symlinks.
The . at end of the source path is a specific cp syntax that allow to copy all files and folders, included hidden ones.

Please follow and like us:
0

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.