How do I copy files under Linux operating systems? How do I make 2nd copy of a file?

GechTux

Image

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

Where,

  • 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

Advertisements

Feel free to comment on any of my blog posts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s