You are here: Home Tech Notes Linux Linux: Copy Directory Structure Only
Linux: Copy Directory Structure Only PDF Print E-mail
User Rating: / 2
PoorBest 
Tech Notes - Linux
Written by Rick   
Friday, 11 September 2009 18:00

I ran across the need to copy a large directory structure to a remote machine this week. I just needed the directory structure, not the files. There is a way to do this locally using the cp command with the --parent switch, though I haven't tried it yet.

Doing it remotely requires rsync;

rsync -av --include '*/' --exclude '*' source-dir dest-dir

Works like a charm.
Comments (0)
Write comment
Your Contact Details:
Gravatar enabled
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):S
:!::?::idea::arrow:
Security
Please input the anti-spam code that you can read in the image.