Questions tagged [cp]

cp is the copy command.

For *nix:

Copy one or more files to another location

Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

manpage

For Windows

Allows the user to copy one or more files to an alternate location.

More info here

71 questions
0
votes
1 answer

Reverse and modify copy file to all subfolders command, xargs

i found this online it copy file to every sub folder on the current dir for full tree depth find -maxdepth 1 -type d -print0 | xargs -0 -n1 cp -v .htaccess now would be nice if it could ask if the file already exist or at least overwrite if file…
JohnA
  • 101
0
votes
3 answers

copy and rename files

Here are my access logs those I want to backup. /var/log/httpd/access_log /var/log/httpd/access_log.1 /var/log/httpd/access_log.2 /var/log/httpd/access_log.3 ... I want to copy all these files but with different name: The following does work as…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
0
votes
2 answers

How to clone with cat?

I want to clone an 8.1gig bootable disk to an 8.0gig disk and have the clone remain bootable. dd causes problems because the destination disk is a few mb smaller than the source. Can "cat" help me here? cp and rsync didn't work either for some…
0
votes
2 answers

Copy data to a directory

I use the following command to copy data and it is working as expected. cp -pr --reply=yes /db-nfs/mysql3/* /db-nfs/mysql5/ 1) Is there a better way? 2) I want to copy the same data to /db-nfs/mysql7 as well. Is it possible in single command?
shantanuo
  • 3,579
  • 8
  • 49
  • 66
0
votes
1 answer

New external backup drives - first time backup - cp or rsync

I've just bought a clutch of external drives to start a rotating backup of my photography work, and wonder if I should just do a straight copy the first time around, or if rsync would be the better option? I will then use rsync to update the backup…
HorusKol
  • 751
  • 5
  • 13
  • 31
0
votes
1 answer

Rsync : Preserve date after copying

I have an issue with files attributes since I changed my company's file system from an old ubuntu 12 to a Synology NAS. I initially mounted NFS shares on my old file system, then with cp I copied everything, everything was ok But i forgot to…
Mmmax
  • 1
  • 1
0
votes
1 answer

Self-Hosted Github runner, how do privileged commands work?

What I'm trying to achieve: A fully automated deployment for a React App, on any commit to the live branch, by my own defined Github Runner, which is running Ubuntu Server 20.04, with npm 6.14.8 What I have so far: autodeploy.yml name:…
Ben
  • 1
  • 1
  • 3
0
votes
2 answers

Making a copy of all .acignore->.gitignore in place, recursively

I have the following file structure as an example c -Git -GitBranchTest .acignore [lots more files] -subfolder .acignore [lots more files] I am trying to make a copy of all the .acignore files…
n4rzul
  • 103
  • 2
-1
votes
3 answers

copy files, get file names from a list

I am using a command: xargs -a file_list.txt cp -t /path/to/dest but the filenames with whitespace get cut and therefore are not copied. what can be done?
Rami
  • 1
  • 2
-1
votes
3 answers

CP command making recursive directories

Okay so what I'm trying to do is that I have a file and I have to replace about 100 files in the location: /home/*/service*/files/ using that file recursively. I used the following command: cp -r File.txt /home/*/service*/files cp: overwrite…
Asad Moeen
  • 437
  • 3
  • 11
  • 22
-1
votes
1 answer

Safest way to move a mount point that is a parent of other mount points on Linux to a new physical device

I goofed up and /var/lib/kubelet was not mounted on a server. So it was on the root. I noticed this and I want to fix it. I did the stupid thing and just tried to stop the associated services (kubelet), rename the existing directory to…
tacos_tacos_tacos
  • 3,250
  • 18
  • 63
  • 100
1 2 3 4
5