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]
On 5/3/07, Dave Lloyd <EMAIL:PROTECTED> wrote:
On Thu, 3 May 2007, Dave Lloyd wrote:

> On Thu, 3 May 2007, Mike Miller wrote:
>
>> I don't think this exists, but this is what I'd like:  A way to copy a
>> directory tree but ignoring certain files, or copying files of a certain
>> type only.
>>
>> I have a directory tree with MP3 files in it, but there also are HTML files
>> (album reviews) and JPEG files (album covers).  I would like to replicate
>> that directory tree without the MP3 files.  I know that I could copy the
>> whole thing and then delete the MP3 files, but they are huge and that is
>> not feasible.

> find ./ -name \*mp3 -exec cp {} /newpath \;

probably even better would be

find ./ -name \*mp3 -print | cpio -ocv | (cd /newpath ; cpio -id )

But he wants to skip the mp3 files; basically, he wants the equivalent of -v in grep. I may be missing something, but it's not obvious this is easily doable. Something like:

find ./ -print | grep -v \*mp3 | blahblahblah

might do it, but somebody else seems to have found a great way using
rsync, which may moot this.

jking

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