[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Copy all except one

Hello Russel, 
if you're still fiddling, you may check out the following. You'll need no 
mkdir this way.  

# Copy Directory-Tree beginning from $SOURCE, with 
# Subdirs and single files, excluding Directory $EXDIR:

find $SOURCE -path $EXDIR -prune -or -print | cpio -pdv $TARGET

# < -print > will only be evaluated, if the < -prune > expression ist not 

# Two different EXDIRs:
find $SOURCE -path $EXDIR1 -prune -or -path $EXDIR2 -prune -or -print | cpio 
-pdv $TARGET

And so on. SOURCE=/bin and TARGET=/mnt should create a /mnt/bin directory.


Reply to: