Tagged Questions
1
vote
2answers
91 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 ...
4
votes
2answers
462 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 ...
8
votes
3answers
387 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
130 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 ...
15
votes
3answers
2k 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
512 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
295 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
231 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 ...