MLUG: RE: [MLUG] cp -R --skip [pattern]?
RE: [MLUG] cp -R --skip [pattern]?
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Then use Dave's cpio solution:
 
  find . -type f ! -name \*.mp3 -print | cpio -ocv | ( cd /new/location ; cpio -id )
 
This works fine.  rsync would also work quite well, but *then* I'd have to look at the man page ;)
 
One could also use tar and xargs if they were so inclined.  TMTOWTDI:
 
  find . -type f ! -name \*.mp3 -print | xargs echo | xargs tar -cvf - | ( cd /new/location ; tar -xf - )
 
or, getting rid of the extraneous echo/xargs:
 
  tar -cvf - `find . -type f ! -name \*.mp3 -print ` | ( cd /new/location ; tar -xf - )
 
There's about a million ways to do it actually...
 
  ryan woodsmall
    EMAIL:PROTECTED

"Be well, do good work, and keep in touch." - Garrison Keillor

________________________________

From: EMAIL:PROTECTED on behalf of Stephen Montgomery-Smith
Sent: Thu 5/3/2007 12:15 PM
To: MLUG Members
Subject: Re: [MLUG] cp -R --skip [pattern]?



Woodsmall, Ryan (IATS) wrote:
> Use the "!"
> 
>   find . -type f ! -name \*.mp3 -exec cp {} /new/path \;
> 
> or use the "-print" option to pipe filenames to cp, mv, tar, cpio, etc.  This will copy anything that is NOT an mp3 file.  rsync is awesome and all, but it's overkill for something like this.
> 

But it won't copy the directory structure.

Personally I think rsync is a totally cool idea.  Better than my tar idea.

<<winmail.dat>>

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members