Questions tagged [cp]
cp - Command-line tool to copy a file
795 questions
3 votes
2 answers
215 views
How to preserve creation time when copying [duplicate]
I want to preserve Access, Modify and Birth timestamps when copying files. I tried the following flags. rsync --atimes --times --crtimes --archive However I get an error that crtimes is not supported....
6 votes
1 answer
764 views
tar not preserving symlinks
How to create an archive containing links and the linked files. I have some shared libraries of which I want to create an archive. This is what I tried mkdir dest #abc.so is a link file which points ...
-1 votes
1 answer
170 views
why doesn't cp automatically copy directories recursively?
Why does cp need -r flag to copy "recursively"? Why doesn't cp automatically copy directories recursively? Would that make more sense? Is there some documentation that explains this decision?...
0 votes
1 answer
92 views
Linux - Copying files from multiple nested folders, with same file names to a single folder
I need help copying a large bunch of files. Let me try to explain the problem here SOURCE STRUCTURE is in /home/user/ToddCrimson/Pictures/iPhone-Media/ (It has JPGs, PNGs, MOVs etc, so I will need a ...
0 votes
0 answers
89 views
To copy using cp non-recursively if the '-a' option is already used
BSD cp: -a Archive mode. Same as -RpP options. Preserves structure and attributes of files but not directory structure. -P No symbolic links are followed. This is the ...
0 votes
0 answers
51 views
Weird cp behaviour when script is executed from systemd
I have a script that behaves weirdly when executed from systemd if I use cp instead of cat. My script: #!/bin/bash steamcmd +login anonymous +app_info_update 1 +app_info_print 3017300 +quit | grep -Po ...
0 votes
1 answer
130 views
What is the difference between "cp /tmp/a ./" and "cp /tmp/a ."
What is the difference between cp /tmp/a ./ and cp /tmp/a . (i.e. with and without the trailing slash in destination)? They both mean copying /tmp/a to current directory, but I see some people insist ...
5 votes
1 answer
1k views
How to use cp's --update=none-fail option
I have cp (GNU coreutils) 9.5 on Arch Linux. The help seems to claim it has a --update=none-fail option, which will fail if a destination file already exists: $ cp --help | grep '\--update\[=' -A1 --...