Results 1 to 2 of 2
Hello all, I have a directory on a text only machine that is 17GB that I have to transfer over to another machine. Unfortunately all I have to do it ...
- 05-22-2008 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 4
Copy recursively, omit one subdirectory
Hello all, I have a directory on a text only machine that is 17GB that I have to transfer over to another machine. Unfortunately all I have to do it with is a 2GB flash drive. There's one subdirectory inside this directory that is 16GB, so if I could copy all the files/directories except this one it'd make it a lot easier(I could then go through and get only what I needed from it.
So if I've got a directory named "top" and it has ~100 files and ~20 sub directories, one of named "data" that is 16GB. How would I go about copying everything but "data"?
Kind of like this:
if that makes any sense.Code:cp -r top -omit /data /mnt/usb/destination
Thanks!
- 05-22-2008 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
Use tar instead of cp because it has the --exclude option.
Code:tar -cvf - --exclude top/data top | (cd /mnt/usb/destination; tar -xvf -)


Reply With Quote