MLUG: Re: [MLUG] copying many trees together
Re: [MLUG] copying many trees together
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mike Miller wrote:
Suppose I have a bunch of directory trees like these and there may be files in any all of the directories:

A-- foo
    `-- bar


B-- foo `-- bar `-- billy `-- willy


C-- foo `-- bar `-- billy `-- sue


D-- foo `-- bar `-- sally `-- joe


E-- foo `-- baz `-- fun `-- stuff


F-- foo `-- baz `-- unfun `-- stuff

I want to put all of those directories, with the files into a single tree like so:

X-- foo
    |-- bar
    |   |-- billy
    |   |   |-- sue
    |   |   `-- willy
    |   `-- sally
    |       `-- joe
    `-- baz
        |-- fun
        |   `-- stuff
        `-- unfun
            `-- stuff

This could be done in succession with files from A copied first, then B, then C, etc., and it would be fine to overwrite files because files with the same name in the same position in the tree are always identical.

What's the best way to do this? Is there anything made for this? Does rsync do this kind of thing? I wish cp could do it but I don't see an option for it.

Mike

How about

mkdir X
rsync -av [A-F]/* X/.


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