How To Copy Entire Directory In Linux?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/copy-entire-directory-linux/
PINTEREST
PINTEREST
INSTAGRAM

Linux provides different tools to copy directories entirely. The most popular and well known tool is cp . In this tutorial we will look how to copy Linux directories entirely or specific contents.

Copy Only Directory

In this first example we will copy only directory. We can just provide the source directory and destination directory names to the cp command. In this example we will try to copy single directory. As we can see we get an error like below.

Copy Only Directory

Copy Only Directory

Copy Entire Directory Recursively

Now here is the real scenario. We will copy our directory named backup with new named newbackup . We will use -r option which makes copy operation recursively. Recursive means sub directories and files will be copied too.

Copy Entire Directory Recursively

Copy Entire Directory Recursively

Copy Special Files

During recursive copy operation special files content will not copied by default. We can copy special file contents with -b option like below.

Copy Verbosely

During copy operation there will be no sign about current operation. We can made this copy operation verbose where copied files will be printed to the shell. We will use -v command like below.

Copy Verbosely

Copy Verbosely

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/copy-entire-directory-linux/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Linux Bash test Command Tutorial With Examples

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)