github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/utils/man/test_cp.txt (about) 1 CP(1) User Commands CP(1) 2 3 NAME 4 cp - copy files and directories 5 6 SYNOPSIS 7 cp [OPTION]... [-T] SOURCE DEST 8 cp [OPTION]... SOURCE... DIRECTORY 9 cp [OPTION]... -t DIRECTORY SOURCE... 10 11 DESCRIPTION 12 Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. 13 14 Mandatory arguments to long options are mandatory for short options too. 15 16 -a, --archive 17 same as -dR --preserve=all 18 19 --attributes-only 20 don't copy the file data, just the attributes 21 22 --backup[=CONTROL] 23 make a backup of each existing destination file 24 25 -b like --backup but does not accept an argument 26 27 --copy-contents 28 copy contents of special files when recursive 29 30 -d same as --no-dereference --preserve=links 31 32 --debug 33 explain how a file is copied. Implies -v 34 35 -f, --force 36 if an existing destination file cannot be opened, remove it and try again (this option is ignored when the -n option is also used) 37 38 -i, --interactive 39 prompt before overwrite (overrides a previous -n option) 40 41 -H follow command-line symbolic links in SOURCE 42 43 -l, --link 44 hard link files instead of copying 45 46 -L, --dereference 47 always follow symbolic links in SOURCE 48 49 -n, --no-clobber 50 do not overwrite an existing file (overrides a -u or previous -i option). See also --update 51 52 -P, --no-dereference 53 never follow symbolic links in SOURCE 54 55 -p same as --preserve=mode,ownership,timestamps 56 57 --preserve[=ATTR_LIST] 58 preserve the specified attributes 59 60 --no-preserve=ATTR_LIST 61 don't preserve the specified attributes 62 63 --parents 64 use full source file name under DIRECTORY 65 66 -R, -r, --recursive 67 copy directories recursively 68 69 --reflink[=WHEN] 70 control clone/CoW copies. See below 71 72 --remove-destination 73 remove each existing destination file before attempting to open it (contrast with --force) 74 75 --sparse=WHEN 76 control creation of sparse files. See below 77 78 --strip-trailing-slashes 79 remove any trailing slashes from each SOURCE argument 80 81 -s, --symbolic-link 82 make symbolic links instead of copying 83 84 -S, --suffix=SUFFIX 85 override the usual backup suffix 86 87 -t, --target-directory=DIRECTORY 88 copy all SOURCE arguments into DIRECTORY 89 90 -T, --no-target-directory 91 treat DEST as a normal file 92 93 --update[=UPDATE] 94 control which existing files are updated; UPDATE={all,none,older(default)}. See below 95 96 -u equivalent to --update[=older] 97 98 -v, --verbose 99 explain what is being done 100 101 -x, --one-file-system 102 stay on this file system 103 104 -Z set SELinux security context of destination file to default type 105 106 --context[=CTX] 107 like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX 108 109 --help display this help and exit 110 111 --version 112 output version information and exit 113 114 ATTR_LIST is a comma-separated list of attributes. Attributes are 'mode' for permissions (including any ACL and xattr permissions), 'ownership' for user and group, 'timestamps' for file timestamps, 'links' for hard links, 115 'context' for security context, 'xattr' for extended attributes, and 'all' for all attributes. 116 117 By default, sparse SOURCE files are detected by a crude heuristic and the corresponding DEST file is made sparse as well. That is the behavior selected by --sparse=auto. Specify --sparse=always to create a sparse DEST file 118 whenever the SOURCE file contains a long enough sequence of zero bytes. Use --sparse=never to inhibit creation of sparse files. 119 120 UPDATE controls which existing files in the destination are replaced. 'all' is the default operation when an --update option is not specified, and results in all existing files in the destination being replaced. 'none' is 121 similar to the --no-clobber option, in that no files in the destination are replaced, but also skipped files do not induce a failure. 'older' is the default operation when --update is specified, and results in files being re‐ 122 placed if they're older than the corresponding source file. 123 124 When --reflink[=always] is specified, perform a lightweight copy, where the data blocks are copied only when modified. If this is not possible the copy fails, or if --reflink=auto is specified, fall back to a standard copy. 125 Use --reflink=never to ensure a standard copy is performed. 126 127 The backup suffix is '˜', 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 are the values: 128 129 none, off 130 never make backups (even if --backup is given) 131 132 numbered, t 133 make numbered backups 134 135 existing, nil 136 numbered if numbered backups exist, simple otherwise 137 138 simple, never 139 always make simple backups 140 141 As a special case, cp makes a backup of SOURCE when the force and backup options are given and SOURCE and DEST are the same name for an existing, regular file. 142 143 AUTHOR 144 Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. 145 146 REPORTING BUGS 147 GNU coreutils online help: <https://www.gnu.org/software/coreutils/> 148 Report any translation bugs to <https://translationproject.org/team/> 149 150 COPYRIGHT 151 Copyright © 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. 152 This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. 153 154 SEE ALSO 155 Full documentation <https://www.gnu.org/software/coreutils/cp> 156 or available locally via: info '(coreutils) cp invocation' 157 158 GNU coreutils 9.3 April 2023 CP(1)