cp is the command of the Unix operating system that is used to copy files.

learn more… | top users | synonyms

1
vote
2answers
2k views

How to Copy Large Directory to External Hard Drive Linux

I've formatted a 3TB external hard drive as ext4 using fdisk (actually gnu fdisk), mounted it at /media/external and am trying to copy my entire home directory to it. My first attempt I thought was ...
0
votes
2answers
71 views

Laptop fan not turning on for graphics

About two years ago, I purchased a samsung series 5 (not the ultra book, the NP510r5e). Every now and then, when there I run something graphically demanding, the laptop just shuts down. I first ...
0
votes
2answers
147 views

Different performance for different USB 2.0 devices

I copied a 3.5GB file from my SATA HD to my Seagate USB 2.0 external HD in about 3 minutes. I copied the same 3.5GB file from my SATA HD to my USB 2.0 SanDisk Cruzer and it took more than 15 minutes. ...
0
votes
2answers
1k views

rtorrent copy after download

so I`m trying to do the following: When rtorrent finishes download, it should copy files from download dir to another dir called uploads, so the file would be in Downloads dir AND in Uploads dir. ...
-2
votes
2answers
66 views

Copy sequential files into sequential directories

I need to copy multiple, sequential files into sequential directories. The files have the julian date (day of year) with other info in the file name. The directories are listed by julian date (day of ...
1
vote
1answer
14 views

Keyboard command in shell for skipping file during copy

Probably a stretch but is there a keyboard command that is accepted by cp from the shell (using bash/zsh) to skip a currently copying file for example if I am recursively copying a folder structure of ...
1
vote
1answer
53 views

execute script with sudo and check security

I have a script, which I need to execute with sudo. #!/bin/bash cp "$@" /destionation/dir Is it a good script or someone can bypass the restriction destination dir ? Thanks for suggestions.
1
vote
1answer
1k views

cp -a is preserving ownership, from non-root user

When I invoke cp -a 1 2 from a non-root user, the ownership is being preserved, despite the fact that file 1 belongs to another user. My understanding was this shouldn't be possible. What is going ...
1
vote
1answer
1k views

permission denied while copying files with root

Ok, how is it possible that I get perm denied when I'm copying files in console. Any ideas?
0
votes
1answer
130 views

Merging two directory trees with same structure, but different contents in Unix

I have two directories with the following structure: A |_0 |_1 |_2 B |_0 |_1 |_2 each 0,1,2 directory contains unique contents. I want all of the contents to simply exist as: A |_0 |_1 |_2 Is ...
0
votes
1answer
261 views

How do I create numbered backups?

Some GNU utils (e.g., mv and cp) can create numbered backups (foo.~1~). Others (e.g., wget) cannot. I would like to create numbered backups before running tools which overwrite files by default. Here ...
1
vote
0answers
75 views

cp: cannot stat error - when filename has Asian characters

I am simply trying to copy files using cp -r /home/user/source/ /home/user/destination/ but it throws me the cp: cannot stat /source/filename.xxx error for some of the files. When I searched for this ...
1
vote
0answers
64 views

Is cp -au / cp --archive --update contradictory?

I want to update a directory on a backup disk with new content added to the source, and of course rsync is too slow. cp -a does the trick but is a bulldozer; cp -u should leave existing files alone. ...
1
vote
0answers
279 views

Why is tar|tar so much faster than cp?

For recursively copying a directory, using tar to pack up a directory and then piping the output to another tar to unpack seems to be much faster than using cp -r (or cp -a). Why is this? And why ...
1
vote
0answers
209 views

File copying times out Single User mode mac

I have an old 2009 MacBook that recently crashed. I can't boot into safe mode, but I can boot into Single User mode, verify my disk, and mount a USB drive and copy files to that USB. However, my ...
1
vote
0answers
850 views

How can I copy files recursively without overwriting the directories

On linux, let's say I have some files like this: dir1/file1 dir2/file2 and I want to copy them to a destination that already have dir1 and dir2 and looks like: dir1/file1 dir1/file1a dir2/file2 ...
1
vote
0answers
235 views

shortcut to recursively copying a directory preserving modes, ownerships and hard and symbolic links

I am using the following to recursively copy a directory while preserving modes, permissions as well as hard and symbolic links: cp -pr --preserve=links dir-a dir-b However I have the following ...
1
vote
0answers
70 views

Maintaining peak IO potential with DD / CP

I wanted to copy a file (40 gig dataset) from a single drive to a dual disk raid-0 drive. I tried with CP and it sustained read - 4mb and write - 11 mb (doesn't make sense I know (must be the stripe ...
0
votes
0answers
21 views

Linux cp command: Auto-rename files, windows-like, FAT32, file name restrictions, ignore symbolic links

Linux cp command: How can I auto-rename all files to conform to windows or FAT32 formatted device file name restrictions, and ignore all symbolic links? I am trying to copy the contents of my dropbox ...
0
votes
0answers
17 views

How do I copy a Mac volume using cp?

I have researched this for hours. In Single User Mode, I used cp -Rpvn /* /Volumes/MyBackup My external USB is mounted on /Volumes/MyBackup The issue however is that after 24hrs it still has not ...
0
votes
0answers
48 views

GNU tar and condensed sparse files

My version of tar doesn't appear to be able to make non-sparse files sparse, though cp does. Are some tar implementations capable of this? (This answer suggests that they may be.) $ dd if=/dev/zero ...
0
votes
0answers
32 views

how to update a directory that is a mirror of another one (with hard-links)?

I like using cp -rl dir1 dir2 to make a recursive copy of dir1 into dir2 (using hard links to save storage, and usually followed by rsync to make progressive backups). The issue is that, if dir2 ...
0
votes
0answers
26 views

cp file in /dev/sdc, now drive isn't readable

So I was trying to instal Arch on my Laptop, and I wanted to copy boot.efi into my usb. cp boot.efi /dev/sdc cp boot.efi /dev/sdc1 cp boot.efi /dev/sdc2 and now its not being read. How can I fix my ...
0
votes
0answers
124 views

cp didn't copy all files few files were missing

How is it possible that cp didn't copy all files from a huge directory? I did cp on a large directory with 5000 files. I checked contents with diff and it was not matching! How is this possible? I ...