Linux--CP

Source: Internet
Author: User

CP (1) User Commands CP (1)



NAME
cp-copy Files and directories

Synopsis

Copy a file to another place, note that you want to add a filename
CP [OPTION] ... [-T] SOURCE DEST

Copy multiple files to another directory
CP [OPTION] ... SOURCE ... DIRECTORY
CP [OPTION] ...-t DIRECTORY SOURCE ...
Copy directory to another directory

CP [OPTION] ...-a DEST. D TARGET. D


DESCRIPTION
Copy source to DEST, or multiple source (s) to DIRECTORY.

Mandatory arguments to long options is Mandatory for short options too.

*********************************************************************************
-A,--archive
Same AS-DR--preserve=all

-R,-R,--recursive
Copy directories recursively

-d Same as--no-dereference--preserve=links

# Copy only links without copying related files, keep links

-P,--no-dereference
Never follow symbolic links in SOURCE


-L,--link
Hard link files instead of copying

-L,--dereference
Always follow symbolic links in SOURCE


-S,--symbolic-link
Make symbolic links instead of copying

-H Follow command-line symbolic links in SOURCE
********************************************************************************


      --attributes-only #仅复制自己所拥有的
               don ' t copy the file data, just the attributes

       --backup[=control]
               make a backup of each existing destination file

      -b      like--backup but does not accept an argument

      --copy-contents< br>              copy contents of special files When recursive

 
******************************************************************************* *****************************


      -F,--force
               If an existing destination file cannot being opened, remove it and try again (this option is I gnored when The-n option is also used)

      -I,--interactive
  & nbsp;           Prompt before overwrite (overrides a previous-n option)


      -N,--no-clobber
               do not overwrite an existing file (Overrides a previous-i option)

-U,--update
Copy only if the SOURCE file is newer than the destination file or when the destination file is missing

-V,--verbose
Explain what's being done

****************************************************************************************************

Some information about the file changes during the copy process, and we use the following options to persist or discard the information:


-p Same as--preserve=mode,ownership,timestamps

--preserve[=attr_list]
Preserve the specified attributes (default:mode,ownership,timestamps), if possible additional attributes:context, links , Xattr, all
Rights owner Timestamp Content link all
--no-preserve=attr_list
Don ' t preserve the specified attributes

********************************************************************************************************

--parents
Use full source file name under DIRECTORY


--reflink[=when]
Control Clone/cow copies. See below

--remove-destination
Remove each existing destination file before attempting to open it (contrast with--force)

--sparse=when
Control creation of sparse files. See below

--strip-trailing-slashes
Remove any trailing slashes from each SOURCE argument


-S,--suffix=suffix
Override the usual backup suffix

-T,--target-directory=directory
Copy all SOURCE arguments to DIRECTORY

-T,--no-target-directory
Treat DEST as a normal file



-X,--one-file-system
Stay on the This file system

--help Display this Help and exit

--version
Output version information and exit

By default, sparse SOURCE files was detected by a crude heuristic and the corresponding DEST file is made sparse as  Well. That's the
Behavior selected by--sparse=auto. Specify--sparse=always to create a sparse DEST file whenever the SOURCE file contains a long enough
Sequence of zero bytes. Use--sparse=never to inhibit creation of sparse files.

When--reflink[=always] was specified, perform a lightweight copy, where the data blocks was copied only when modified. If This is not pos‐
Sible the copy fails, or if--reflink=auto is specified and fall back to a standard copy.

The backup suffix is ' ~ ', and unless set with--suffix or Simple_backup_suffix. The version control method may be selected via the--backup
option or through the VERSION_CONTROL environment variable. Here is the values:

None, off
Never make backups (even if--backup is given)

Numbered, T
Make numbered backups

Existing, nil
Numbered if numbered backups exist, simple otherwise

Simple, never
Always do simple backups

As a special case, CP makes a backup of SOURCE when the force and backup options is given and SOURCE and DEST is th E same name for an
Existing, regular file.

AUTHOR
Written by Torbjorn Granlund, David MacKenzie, and Jim meyering.

REPORTING BUGS
Report CP Bugs to [email protected]
GNU coreutils Home page: General help using GNU software: Report CP translation Bugs to
COPYRIGHT
copyright©2013 Free Software Foundation, Inc. License gplv3+: GNU GPL version 3 or later This was free software:you was free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

See ALSO
The full documentation to CP is maintained as a Texinfo manual. If the info and CP programs is properly installed at your site, the com‐
Mand

Info coreutils ' CP invocation '

Should give you access to the complete manual.



GNU Coreutils 8.21 March 2014 CP (1)

Linux--CP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.