1
vote
2answers
38 views

moving files of certain formats from subdirectoris to directories with same folder names

I’ve got a weird situation. I have 100s of folders with flac and mp3 copies of the same tracks. I need to separate the mp3s from the flacs and put them into similarly named directories. for example: ...
2
votes
1answer
29 views

Confusion on the cp command when creating a new directory

Let me explain my problem with a simpler scenario. We have these two directories: ~/Foo and ~/Bar. Foo contains the files test1.txt and test2.txt. If I run the command cp -R Foo Bar, the Bar directory ...
2
votes
3answers
522 views

cp --no-target-directory explained

Question: I need a simple example of how to use cp --no-target-directory. I do experience some difficulties in understanding cp --no-target-directory. I do understand the explanation for mv ...
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 ...
1
vote
2answers
335 views

Can one copy a relpath in one command?

I find myself doing this often enough that I wonder if there's a standard Unix way to do it: % mkdir -p /TARGETDIR/relative/path/to % cp ./relative/path/to/somefile /TARGETDIR/relative/path/to In ...
7
votes
4answers
2k views

pv for directory copy

I need to copy a very large directory (talking in terabytes here) and want to monitor the progress. I found that pv is a nice utility, but how can I use it for copying directories recursively? (pv ...
11
votes
3answers
2k views

Flattening a nested directory

This is probably very simple, but I can't figure it out. I have a directory structure like this (dir2 is inside dir1): /dir1 /dir2 | --- file1 | --- file2 What is ...
2
votes
2answers
187 views

cp file device:directory on Minix

In my operating systems class we had to modify the boot screen of the Minix OS. I understood just about everything we did, but at the end of the make for compiling the new OS, there's a line: cp ...
21
votes
3answers
5k views

Why unix mv program doesn't need -R (recursive) option for directories but cp does need it?

This is a kind of "wtf?" question, so I'm sorry if I will disturb someone's vision of how things should be or if I will just annoy you with the "stupid" question. I always get messed up when need to ...
2
votes
4answers
678 views

Make directory copies using find

I have a directory with a bunch of subdirectories in it. Thus /usr/local/src/ccl/ccl-1.8/x86-headers$ ls elf gl gmp gnome2 gtk2 jni libc Each of these directories has a further subdirectory C ...
2
votes
2answers
2k views

How can I selectively copy files from one directory to another directory?

On Linux, how do I selectively copy most – but not all – files from a directory (dir1) to another directory (dir2)? I do not want to copy *.c and *.txt files to dir2. The cp man page ...
3
votes
3answers
330 views

Delete files in a directory which are also in another directory

I copied a directory using this: cp -r dir/ ../../ without thinking and realized that it copied the contents of dir instead of actually dir to the above directory. Now I have a mess of files I need ...
0
votes
1answer
529 views

Why can I not copy a direcotry from *nix to a mounted smbfs share on Windows 7?

I've mounted a Windows 7 directory on my FreeBSD box via smbfs: mount ... //ROOT@BARYONYX/GVKV on /usr/home/gvkv/win (smbfs) but for some reason when I try to copy a directory: cp .vim /win I ...