Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

Copy a directory structure with no files

In linux / unix



9:53 am on Dec 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi, Can someone point me in the right direction on how I can copy over about 2000 directories to a new disk, without copying files.

I'm sure it involves find, xargs and cp, just cant figure out the right way to do this.


4:22 pm on Dec 10, 2004 (gmt 0)

10+ Year Member

Try unixjunkie.net qestion 5 on unix info page, might help.

Oh and check your stickymail.


2:26 am on Jan 13, 2005 (gmt 0)

10+ Year Member

find ./ -type d ¦while read l; do mkdir /directory/$l; done

inefficient, throws errors, should work.


5:24 am on Jan 13, 2005 (gmt 0)

10+ Year Member

mkdir /where/you/wantem

cd /source/dir

find * -type d -exec mkdir /where/you/wantem/\{\} \;

Featured Threads

Hot Threads This Week

Hot Threads This Month