Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » CommandsRSS Feeds

Copy file and directory subtrees - cp

Posted By: Pedro Silva     Category: Unix / Linux / Ubuntu     Views: 7902

This article explains about cp command with an example in unix.

cp command is used to  copy file and directory subtrees in unix.

Syntax of cp Command

cp [- options]  oldfile newfile


Examples of cp Command

Example 1 : Copy file1 to new or existing new_file

cp file1 new_file

Example 2 : Copy file1 to existing directory

cp file1 destination_directory

Example 3 : To create a zero-length file

cp /dev/null file
  
Share: 


Didn't find what you were looking for? Find more on Copy file and directory subtrees - cp Or get search suggestion and latest updates.

Pedro  Silva
Pedro Silva author of Copy file and directory subtrees - cp is from Salvador, Brazil.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Unix / Linux / Ubuntu:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!