Linux: HowTo Copy a Folder [Command Line]

cp = copy Command

cp is a Linux command for copying files and directories. The syntax is as follows:

In this example we try to copy /home/USR/some/dir folder and all its files to /home/USR/nfs-mounts directory

Where -avr means:

  • -a : Preserve the specified attributes such as directory and file mode, ownership, timestamps, and so on.
  • -v : verbose: Explain what is being done.
  • -r : Copy directories recursively.


Copy a directory called /dir/some/files to /home/USR-123/documents:



Leave a Reply

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