558
Comment:
|
638
first-line, }}}, and placeholder for pax
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
[[Anchor(faq10)]] | <<Anchor(faq10)>> |
Line 4: | Line 4: |
{{{ cd "$srcdir" find . -type d -print | cpio -pdumv "$dstdir" }}} |
|
Line 9: | Line 5: |
or with GNU-{{{tar}}}, and less obscure syntax: | {{{ cd "$srcdir" find . -type d -print | cpio -pdumv "$dstdir" }}} |
Line 11: | Line 10: |
{{{ cd "$srcdir" find . -type d -print | tar c --files-from - --no-recursion | tar x --directory "$dstdir" }}} |
or with GNU {{{tar}}}, and more verbose syntax: |
Line 16: | Line 12: |
This creates a list of directory names with find, non-recursively adds just the directories to an archive, and pipes it to a second tar instance to extract it at the target location. | {{{ cd "$srcdir" find . -type d -print | tar c --files-from - --no-recursion | tar x --directory "$dstdir" }}} This creates a list of directory names with {{{find}}}, non-recursively adds just the directories to an archive, and pipes it to a second {{{tar}}} instance to extract it at the target location. ''There should be a way to do this with `pax` too....'' - GreyCat |
How can I recreate a directory structure, without the files?
With the cpio program:
cd "$srcdir" find . -type d -print | cpio -pdumv "$dstdir"
or with GNU tar, and more verbose syntax:
cd "$srcdir" find . -type d -print | tar c --files-from - --no-recursion | tar x --directory "$dstdir"
This creates a list of directory names with find, non-recursively adds just the directories to an archive, and pipes it to a second tar instance to extract it at the target location.
There should be a way to do this with pax too.... - GreyCat