Copy files and directories
cp -a {archive} -b {flag-b} -d {flag-d} -f {force} -i {interactive} ๐ archive ๐ flag-b ๐ flag-d ๐ force ๐ interactive cp -a {archive} -b {flag-b} -d {flag-d} -f {force} -i {interactive} Sandbox: execFile · Timeout: 30s
system.file.cp system.file.search system.file.process system.file.copy system.file.move system.file.delete | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
archive | string | No | - | same as -dR --preserve=all --attributes-only don't copy the file data, just the attributes --backup[=CONTROL] make a backup of each existing destination file | -a, --archive |
flag-b | string | No | - | like --backup but does not accept an argument --copy-contents copy contents of special files when recursive | -b |
flag-d | string | No | - | same as --no-dereference --preserve=links --debug explain how a file is copied. Implies -v | -d |
force | string | No | - | if an existing destination file cannot be opened, remove it and try again (this option is ignored when the -n option is also used) | -f, --force |
interactive | string | No | - | prompt before overwrite (overrides a previous -n option) | -i, --interactive |
flag-H | string | No | - | follow command-line symbolic links in SOURCE | -H |
dereference | string | No | - | always follow symbolic links in SOURCE | -L, --dereference |
no-dereference | file | No | - | never follow symbolic links in SOURCE --keep-directory-symlink follow existing symlinks to directories | -P, --no-dereference |
link | string | No | - | hard link files instead of copying | -l, --link |
no-clobber | string | No | - | (deprecated) silently skip existing files. See also --update | -n, --no-clobber |
flag-p | file | No | - | same as --preserve=mode,ownership,timestamps --preserve[=ATTR_LIST] preserve the specified attributes --no-preserve=ATTR_LIST don't preserve the specified attributes --parents use full source file ... | -p |
recursive | string | No | - | copy directories recursively --reflink[=WHEN] control clone/CoW copies. See below --remove-destination remove each existing destination file before attempting to open it (contrast with --force) --s... | -R, -r, --recursive |
symbolic-link | string | No | - | make symbolic links instead of copying | -s, --symbolic-link |
suffix | string | No | - | override the usual backup suffix | -S, --suffix |
target-directory | file | No | - | copy all SOURCE arguments into DIRECTORY | -t, --target-directory |
no-target-directory | string | No | - | treat DEST as a normal file --update[=UPDATE] control which existing files are updated; UPDATE={all,none,none-fail,older(default)} | -T, --no-target-directory |
flag-u | string | No | - | equivalent to --update[=older]. See below | -u |
verbose | string | No | - | explain what is being done | -v, --verbose |
one-file-system | string | No | - | stay on this file system | -x, --one-file-system |
flag-Z | file | No | - | set SELinux security context of destination file to default type --context[=CTX] like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX --help display this help and e... | -Z |
attributes_only | boolean | No | - | --attributes-only | |
backup | boolean | No | - | --backup | |
copy_contents | boolean | No | - | --copy-contents | |
help | boolean | No | - | --help | |
keep_directory_symlink | boolean | No | - | --keep-directory-symlink | |
no_preserve | boolean | No | - | --no-preserve | |
parents | boolean | No | - | --parents | |
reflink | boolean | No | - | --reflink | |
remove_destination | boolean | No | - | --remove-destination | |
sparse | boolean | No | - | --sparse | |
strip_trailing_slashes | boolean | No | - | --strip-trailing-slashes | |
version | boolean | No | - | --version |
Basic usage with archive
cp ${archive} Display help message
cp --help cp is a command-line utility for copy files and directories.
cp -a {archive} -b {flag-b} -d {flag-d} -f {force} -i {interactive}