Mailinglist Archive: opensuse (2831 mails)

< Previous Next >
Re: [SLE] Duplicating a directory structure
  • From: stephan beal <stephan@xxxxxxxx>
  • Date: Fri, 28 Jul 2006 11:30:17 +0200
  • Message-id: <200607281130.21992.stephan@xxxxxxxx>
On Thursday 27 July 2006 20:11, Marlier, Ian wrote:
> The current directory structure is something like the following:
> /tmp/origin
...
> `cd /tmp/origin`
> `find . -type d -print | xargs mkdir {}`
>

One way is this:

tar cf /tmp/foo.tar --no-recursion $(find . -type d)

Now foo.tar contains the structure. Simply unpack it to your
destination. If you're clever you can find a way to expand that to not
use a temp tar file, but we'll leave that as an exercise for the
reader :).



--
----- stephan@xxxxxxxx http://s11n.net
"...pleasure is a grace and is not obedient to the commands
of the will." -- Alan W. Watts
< Previous Next >
References