Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- To: "MLUG Members" <EMAIL:PROTECTED>
- Subject: RE: [MLUG] cp -R --skip [pattern]?
- From: "Cutts III, James H." <EMAIL:PROTECTED>
- Date: Thu, 3 May 2007 09:44:25 -0500
- Delivery-date: Thu, 03 May 2007 09:45:35 -0500
- Envelope-to: EMAIL:PROTECTED
- In-reply-to: <EMAIL:PROTECTED>
- References: <EMAIL:PROTECTED>
- Reply-to: MLUG Members <EMAIL:PROTECTED>
- Sender: EMAIL:PROTECTED
- Thread-index: AceNjgYZ+rySxiCITQeeZSUOsAKObwAAwjjg
- Thread-topic: [MLUG] cp -R --skip [pattern]?
Mike,
I bet there's a smart way to use the -name expression in find to select
the files you want.
Here's the section on the -name expression of find from:
http://www.computerhope.com/unix/ufind.htm
-name pattern True if pattern matches the current file name. Normal
shell file name generation characters (see sh) may be used. A backslash
(\) is used as an escape character within the pattern. The pattern
should be escaped or quoted when find is invoked from the shell.
At worse, it could be done in 2 passes one for the HTML and the other
for the JPEG files.
James H. Cutts III
CARES & CORI - 143C Mumford
> -----Original Message-----
> From: EMAIL:PROTECTED
> [mailto:EMAIL:PROTECTED] On Behalf Of Mike Miller
> Sent: Thursday, May 03, 2007 9:19 AM
> To: MLUG membership
> Subject: [MLUG] cp -R --skip [pattern]?
>
> 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.
>
> I would think there is a simply GNUish Linuxy trick to this,
> possibly using "find" somehow. I think I see a way to write
> a script that uses find, but it wouldn't be all that
> efficient. For example, I can write out the entire directory
> tree like so:
>
> find . -type d -print
>
> I can process that output to do what I want, but I see no way
> to do it with xargs -- I would use perl to create a shell
> script from the output, then execute the shell script. But
> isn't there a one-liner for this?
>
> It would be great if one of you guys could suggest something.
>
> Thanks in advance.
>
> Mike
>
> _______________________________________________
> members mailing list
> EMAIL:PROTECTED
> http://mlug.missouri.edu/mailman/listinfo/members
>
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members