• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

cp

cp

cp Copies files.
cp [-R (-H | -L | -P)] [-f | -i] [-p] <source>
								<target>

cp [-R (-H | -L | -P)] [-f | -i] [-p] <source1>
								<source2> ... <directory>
								

In its first form, cp copies the contents of <source> to <target>.
In its second form, cp copies the contents of the list enumerated by <source1> <source2> … to the directory named by <directory>. The names of the files themselves are not changed. If cp detects an attempt to copy to itself, that attempt fails.
-R If <source> is a directory, cp recursively copies the directory. This option also causes symbolic links to be copied, rather than indirected through. Created directories have the same mode as the corresponding source directory.
-H If -R is specified, symbolic links on the command line are followed, but symbolic links in the tree traversal are not.
-L If -R is specified, all symbolic links are followed.
-R If -R is specified, no symbolic links are followed.
-f Forces an existing file to be overwritten. If permissions do not allow copy to succeed, forces the existing file to be removed and a new file to be created, without prompting for confirmation. The -i option is ignored if the -f option is specified.
-i Invokes an interactive mode that prompts for a confirmation before overwriting an existing file.
-p Causes cp to retain as much of the modification time, access time, file flags, file mode, user ID, and group ID information as permissions allow.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint