-   Linux - Software (
-   -   Copy a directory without contents (

zefram 04-28-2009 04:12 PM

Copy a directory without contents

Is there a way to copy a directory without copying the contents, but preserving ownership, timestamp etc of that directory?

I've looked at the cp man page, but I don't think it supports it. I'm thinking one would have to write a script to gather the info, and then mkdir, chown and touch. Does this seam right?

zefram 04-28-2009 04:23 PM

A friend just gave me a way:

rsync -d source dest

Thanks anyway :-)

colucix 04-28-2009 05:06 PM


rsync -dt source destination
if you want to preserve the timestamp, too.

All times are GMT -5. The time now is 10:10 AM.