To copy files and directories use the cp command under Linux, UNIX, and BSD like operating systems. cp is the command entered in a Unix / Linux shell to copy a file from one place to another, possibly on a different filesystem. The original file remains unchanged, and the new file may have the same or a different name.
cp Command Syntax
The syntax is as follows to copy files and directories using the cp command:
cp SOURCE DEST cp SOURCE DIRECTORY cp SOURCE1 SOURCE2 SOURCE3 SOURCEn DIRECTORY cp [OPTION] SOURCE DEST cp [OPTION] SOURCE DIRECTORY
- In the first and second syntax you copy SOURCE file to DEST file or DIRECTORY.
- In the third syntax you copy multiple SOURCE(s) (files) to DIRECTORY.
Linux Copy File Examples
To make a copy of a file called file.doc in the current directory as newfile.doc, enter:
$ cp file.doc newfile.doc $ ls…
View original post 100 more words