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
5
votes
2 answers

Ubuntu cp -p on mounted ZFS pool

On my Ubuntu server, I have several automounted zfs pools. The problem that I have, is that when I try to copy a file while preserving permissions, I get the following error: cp: preserving permissions for `blah.txt': Operation not…
JT.WK
  • 431
  • 6
  • 18
4
votes
1 answer

mv fails but cp succeeds on nfs mount

I am trying to move a file from a local directory to an nfs mounted directory on a CentOS 7 server. The export is provided by FreeNAS. Both directories are owned by the current user with at least 755 (nfs shows as 777 but I'm not sure I believe…
Jacob Tomlinson
  • 403
  • 2
  • 5
  • 15
4
votes
1 answer

What does the message, "too many links" mean when using CP on Linux?

I am copying 25,000 folders containing hundreds of files each from one hard drive to another on the same Linux server. The destination folder already contains 25,000 different folders full of their own files. I am using the following command: cp…
T. Brian Jones
  • 927
  • 4
  • 17
  • 29
3
votes
3 answers

Creating an iso file in Linux

I have created iso files by using two commands: dd if=/dev/cdrom of=filename cp /dev/cdrom filename What's the difference between the two, both have worked for me.
Osama ALASSIRY
  • 824
  • 3
  • 8
  • 22
3
votes
1 answer

Improve RSYNC scan speed / Alternate approach?

I'm using rsync to transfer application log files from one server to another. It works fine with the exception that scanning the directories takes forever. I have around 160,000 log files and a few thousand directories so I can understand why…
Jason
  • 381
  • 1
  • 7
  • 20
3
votes
2 answers

cp from local to usb-drive affects desktop performance

Background While copying a vast number of multi-megabyte sound files, the Kubuntu desktop becomes intermittently unresponsive (the mouse pointer can move, but Firefox, Konsole, and KDE itself temporarily ignore keyboard presses, mouse clicks, and…
Dave Jarvis
  • 235
  • 2
  • 10
3
votes
1 answer

cp -R source_dir/* dest_dir/ does overwrite files?

I am trying to copy, recursively, the content of a directory to another using: cp -Rv source_dir/* dest_dir/ It seems that everything work ok but when I list that directory with ls -l the change data it is not updated to the current time. So, how…
rtacconi
  • 745
  • 4
  • 14
  • 28
2
votes
0 answers

'reboot' command doesn't work properly after 'cp' command, 'mv' behaves weird, as well

I have compiled C code running as a binary on an ARM. The ARM boots Linux from an SD Card using an old Image that was generated using buildroot. Within the C code I call a shell script that moves the new Image I want to boot with from a…
sdepot
  • 21
  • 1
2
votes
1 answer

cp is too slow, same with rsync (I assume) - is there a way to share files in two locations?

I am using Docker and Docker cannot COPY symlinked files into the image. But the files that are symlinked are not in the 'build context'. So I was going to copy them into the build context with cp, but that's really slow. Is there some way to share…
2
votes
0 answers

RHEL 6.7 cache causing out of memory errors

I have a (large) system that has cache behavior that I don't understand. It seems that the cache ran the system out of memory. How is this possible? Doesn't the kernel clean up the cache when there's memory pressure? One of our users ran a 'cp…
gfreestone
  • 31
  • 1
2
votes
2 answers

Copying between lzo compressed BtrFS's: de/re-compressing?

I'm copying a large number of files between two lzo compressed BtrFS filesystems on different drives mounted on the same machine. It appears that the files are being de/re-compressed. Is there a way avoid this?
Diagon
  • 246
  • 1
  • 11
2
votes
2 answers

How to cp only into the latest directory name?

mkdir test_dir test_dir1 test_dir2 test_dir3 touch file1 file2 file3 cp -v file* test_dir*/ This copies only to test_dir3 and not in test_dir, test_dir1, test_dir2. Why? For that matter it copies only to latest directory say test_dir4 and not into…
kumar
  • 433
  • 3
  • 10
  • 23
2
votes
1 answer

/bin/sh: /bin/cp: Argument list too long

I have problem with this command: 'cp' -fr /www/*-aws/* /www/mainhost/aws/awstatstotals/tmp/ Error is Argument list too long - I know many /www/-aws/ folders. I know that I can use FIND command, but I dont know how I can give two wildcard as…
Pavel
  • 417
  • 1
  • 7
  • 17
2
votes
1 answer

RSYNC Slow / Copy only changed files?

I have a server that maintains thousands of log files that are nested in thousands of directories. At the moment, I am using RSYNC to copy those log files to a web server where I parse them and make them available through a web application. My…
Jason
  • 381
  • 1
  • 7
  • 20
2
votes
2 answers

Copy entire filesystem in a folder where a raid-1 array is mounted

I am trying to migrate from a single disk drive system to a double disk drive software raid-1 system that already has a running system on it. Meaning that formatting and having a new installation of ubuntu using raid-1 is NOT an option. In this…