The tag has no wiki summary.

learn more… | top users | synonyms

18
votes
10answers
6k views

Is there a faster alternative to cp for copying large files (~20 GB)?

I am a graduate student, and the group in which I work maintains a Linux cluster. Each node of the cluster has its own local disk, but these local disks are relatively small and are not equipped with ...
10
votes
2answers
781 views

How can I copy a file and create the target directories at the same time?

I want to cp aaa/deep/sea/blob.psd to bbb/deep/sea/blob.psd How do I do the copy if the deep and sea directories don't exist under bbb so that the copy both creates the directories that are needed ...
6
votes
7answers
455 views

Make disk/disk copy slower

Is there a method of slowing down the copy process on Linux? I have a big file, say 10GB, and I'd like to copy it to another directory, but I don't want to copy it with full speed. Let's say I'd like ...
6
votes
1answer
263 views

Is “zero-copy networking” implemented by default on Linux?

I saw this article: http://lwn.net/2001/0419/kernel.php3 Zero-copy networking will be in 2.4.4. This patch, by David Miller, Alexey Kuznetsov, and others, has been in development and testing ...
5
votes
2answers
302 views

Why do hard links seem to take the same space as the originals?

Thanks to some good Q&A around here and this page, I now understand links. I see hard links refer the same inode by a different name, and copies are different "nodes, with different names. Plus ...
5
votes
2answers
5k views

How do I copy a symbolic link?

I have a symbolic link to a file in one directory. I would like to have that same link in another directory. How do I copy a symbolic link? I tried to cp the symbolic link but this copies the file ...
4
votes
2answers
137 views

CP: max source files number arguments for copy utility

Consider that there are countless number of files under /src/ cp /src/* /dst/ How many files cp will successfully process?
4
votes
3answers
197 views

anyway to fail/delay a cp process?

This is a hypothetical scenario. Say that I have a particular folder that is being synchronized by a process which is receiving a files/folders via the internet. Now while this operation is in ...
3
votes
2answers
493 views

How to write file into another

I have an empty file (only zeroes are in it) of size 9,0KB and I need to write another file (with size 1,1KB) to it, but the first file must not lose its size or the rest of its contents. So if the ...
3
votes
3answers
519 views

Merging two directory without copying the files

Let's say I have as follows : Folder A C1 file a A2 Folder B C1 B2 file b B3 What I want is to merge these two folders, which would give me : Folder C ...
3
votes
1answer
100 views

Best way to sync files - copy only EXISTING files and only if NEWER than target

I'm doing this sync locally on Ubuntu 12.04. The files are generally small text files (code). I want to copy (preserving mtime stamp) from source directory to target but I only want to copy if the ...
3
votes
1answer
955 views

copying files from one directory to another

I have to copy a set of files from one folder to another folder and I'm using the following command: cp -rf `head -n 100 /home/tmp/abc.txt` /home/tmp/test/files the file contents in abc.txt is ...
2
votes
1answer
248 views

Minimal command to make a copy of a file [duplicate]

I often find myself copy-pasting long path in order to create a copy of a file cp /path/to/file/file1 /path/to/file/file1.bkp Is there an alternative utility that will NOT require me to type the ...
2
votes
2answers
63 views

open a file and copy the listed files to another folder

I have a file named file1.txtcontaining file names like below : filea.txt fileb.txt filec.txt I want to copy the files listed in file1.txt to another folder. What is the UNIX command to use? (the ...
2
votes
1answer
1k views

Better way to copy multiple directories to new directory

Is there a better way on the command line to essentially accomplish the following but with a single command cp -r css/ ar/ cp -r images/ ar/ cp -r js/ ar/ cp -r backups/ ar/ I've just been ...
2
votes
5answers
197 views

Copy Sequential Files

I have 12 files named dmp_000, dmp_001, etc, all the way to dmp_011. I would like to copy all of them to rdmp_000, rdmp_001, and so on, sequentially so the numbered files coincide. There must be an ...
2
votes
2answers
124 views

Take copy of TTY0 text

I have some output in TTY1 that I think might hold clues as to why my last GUI session froze (CtrlAltBackspace was able to get me back to the terminal and I reloaded the GUI). However, I cannot seem ...
2
votes
2answers
5k views

Easy way to copy lines from one file to another [duplicate]

Possible Duplicate: cat line X to line Y on a huge file Very simple issue but can't seem to find a simple resolution! I have a massive text file from which I only need around 150 lines. ...
2
votes
1answer
26 views

Transfer 2 drive raid0 / lvm2 system to new drive pair

I have a multi-boot, multi-drive system that I want to transfer onto 2 bigger drives. Currently pc has 2x1TB drives with Fedora 19 running, using RAID0 drive mirroring, with LVM2 on top of the md. I ...
2
votes
1answer
70 views

How can I make multiple copies of one folder without merging?

When two or more identically named folders are to be copied into or moved to the same location, the default option either in the GUI file manager, or using in a terminal cp -r --backup=numbered or ...
2
votes
4answers
1k views

Find and copy directories containing file type

I have a directory "Movies" containing subdirectories "Movie Name". Each subdirectory "Movie Name" contains a movie file and related image/nfo files etc. I'm trying to copy all directories containing ...
2
votes
1answer
154 views

Unable to preserve ownership in a copy but able with a move?

I have noticed that I am unable to preserve ownership if I rsync -o files. However, I am when I move them. This is all without admin privileges. What is the rationale of this? Several threads e.g. ...
1
vote
2answers
242 views

Need to copy files to existing directory and remove files already there with the same name but different extension

EDIT: Total rewrite of question for clarity. I have a directory tree (new) with a bunch of files of with an extension of .new. I have an identical tree (old) where many of the files have names ...
1
vote
1answer
55 views

Copy files via a complex ssh connection?

Suppose I have host A from which I ssh to host B, where I sudo -U some_role and from under it ssh to host C. My goal is an interactive shell on C. Assume that from C I cannot ssh back to A. What is ...
1
vote
2answers
54 views

copy files from one path to another path in linux

I am new to linux. I am trying to copy files from one path to another path. I have a text file which has all names of files in the following pattern: file-1.txt file-2.pdf file-3.ppt .... I created ...
1
vote
1answer
48 views

Mass file+folder+directory move

So we have a bunch of src files that are old and out-dated and need to be moved to our new NAS storage. (I don't know why we are keeping them). Is it possible to copy all the files and folders with ...
0
votes
1answer
84 views

vi / vim - extra indents when pasting text? [duplicate]

I can copy characters in other apps such as browsers with ctrlc. I can then press i to enter insert mode in vim and press shiftctrlv to paste the text in. The problem is that each line gets indented ...
0
votes
1answer
308 views

How to copy a folder from remote machine to my system using ssh or any other way

Hi I need to copy a folder of size 885 MB from a remote machine to my system using ssh and port no is 1500 What is the command I can use to accomplish this path of remote folder is ...
0
votes
2answers
56 views

Rsync after copy

Does Rsync after copy only send the differences between the folders, or does it copy the entire folder again since Rsync has never been implemented before on that folder?
0
votes
1answer
165 views

Copy modified files from one server to other

Scenario: 2 Servers (*.12 and *.13) CakePHP "application" on both of them. *.12 is "Production" Server *.13 is "Development" Server Now i want to copy all files modified the last 2 days from test ...
0
votes
0answers
21 views

file modified while doing scp/cp [duplicate]

I'm doing scp to a database while it's active. Its not very critical but I would like to know what will happen to a file when it is modified in the middle of a cp process? Does it get corrupted or it ...
0
votes
2answers
127 views

How do I copy directories and symlink files?

I have got a directory of huge files (total ~ 1TB) and I don't want copy them around. However, I'd like to work around them, so it would be convenient to have them linked in a directory hierarchy I ...
-1
votes
1answer
211 views

How to recursively move batches of 20 files into numbered folders from folder of 1000 files

I have a folder full of 1000 (or more) files. I want to have a script that creates a numbered folder and then moves the first 20 files (ordered by name) into that folder. It should then do this for ...