Welcome to WebmasterWorld Guest from 107.20.75.63

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)

Senior Member from HK 

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 14, 2002
posts:2282
votes: 10


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)

Junior Member

10+ Year Member

joined:Feb 24, 2004
posts:42
votes: 0


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)

New User

10+ Year Member

joined:Jan 11, 2005
posts:3
votes: 0


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)

Full Member

10+ Year Member

joined:Mar 3, 2004
posts:270
votes: 0


or
mkdir /where/you/wantem

cd /source/dir

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