Marlier, Ian wrote:
I need to duplicate a directory structure on a SuSE 10.0 box -- not the files, just the directory tree.
I thought this would be pretty simple, using find, but I'm running into big issues because many (as in almost all) of the directories have spaces in their names. For the life of me I can't get the silly thing to put everything where it should be.
The current directory structure is something like the following: /tmp/origin /tmp/origin/folder one /tmp/origin/folder one/sub folder one /tmp/origin/folder one/sub folder two /tmp/origin/folder one/sub folder three /tmp/origin/folder one/sub folder three/sub sub folder one /tmp/origin/folder one/sub folder three/sub sub folder two /tmp/origin/folder one/sub folder four /tmp/origin/folder two /tmp/origin/folder two/sub folder one . . .
(Suffice it to say that the actual structure is much more complicated, and, well, real. But not essentially different.)
What I'm trying to end up with is something like this: /tmp/dest /tmp/dest/folder one /tmp/dest/folder one/sub folder one /tmp/dest/folder one/sub folder two /tmp/dest/folder one/sub folder three /tmp/dest/folder one/sub folder three/sub sub folder one . . .
I started off by doing this: `cd /tmp/origin` `find . -type d -print | xargs mkdir {}`
which gave me lots of errors like "mkdir folder: file exists" and "mkdir one/sub: file exists". Clearly "folder" and "one/sub" are being seen as distinct file names.
Try this (assuming /tmp/dest/ exists): cd /tmp/dest (cd /tmp/origin; find -type d -print0) | xargs -0 mkdir -p -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com