Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cp (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Modes == The command has three principal modes of operation as inferred from command-line arguments.<ref>{{Cite web | url=https://www.man7.org/linux/man-pages/man1/cp.1.html | title=Cp(1) - Linux manual page }}</ref> ===Copy file=== For a path to an existing file followed by a path that does ''not'' refer to an existing directory, the file at the first path is copied to the second path. cp [-fHip][--] sourcefile targetfile ===Copy files to directory=== For one or more paths to existing files followed by a path to an existing directory, the files are copied to the directory. cp [-fHip] [--] sourcefile... targetdirectory ===Copy directory=== With the recurse command-line option, typically {{code|-r}}, a path to an existing directory and a second path, the files of the directory are copied to the second path. If the second path refers to nothing, the source directory is copied to that path. If the second path refers to an existing directory, the source directory is copied into the destination directory as a subdirectory. cp -r|-R [-fHip] [--] sourcedirectory... targetdirectory
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)