Linux/Unix Commands





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
LINUX / UNIX cmd
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Introduction
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in A
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in B
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in C
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in D
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in E
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in F
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in G
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in H
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in I
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in J
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in K
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in L
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in M
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in N
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in P
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in R
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in S
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in T
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in U
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in W
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Commands in Y
Forums Ask your doubts
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example More about Linux
LINUX/UNIX Commands tutorial/reference - Find linux cmd, syntax, example Feedback
 





cp Linux Commands


Tutorials Linux-commands

Topic

What is Linux cp Command?



Explanation

cp COMMAND:
     cp command copy files from one location to another. If the destination is an existing file, then the file is overwritten; if the destination is an existing directory, the file is copied into the directory (the directory is not overwritten).

SYNTAX:
  The Syntax is
     cp [OPTIONS]... SOURCE DEST
     cp [OPTIONS]... SOURCE... DIRECTORY
     cp [OPTIONS]... --target-directory=DIRECTORY SOURCE...


OPTIONS:
     
-a same as -dpR.
--backup[=CONTROL] make a backup of each existing destination file
-b like --backup but does not accept an argument.
-f if an existing destination file cannot be opened, remove it and try again.
-p same as --preserve=mode,ownership,timestamps.
--preserve[=ATTR_LIST] preserve the specified attributes (default: mode,ownership,timestamps) and security contexts, if possible additional attributes: links, all.
--no-preserve=ATTR_LIST don't preserve the specified attribute.
--parents append source path to DIRECTORY.



EXAMPLE:
     
  1. Copy two files:
    cp file1 file2

    The above cp command copies the content of file1.php to file2.php.


  2. To backup the copied file:
    cp -b file1.php file2.php

    Backup of file1.php will be created with '~' symbol as file2.php~.

  3. Copy folder and subfolders:
    cp -R scripts scripts1

    The above cp command copy the folder and subfolders from scripts to scripts1.





A Note

Find LINUX Commands... Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this LINUX / UNIX cmd reference. This is a copyright content.


Other Links

web hosting

 

Free Hosting

Top Hosting Companies