Copy only folders not files?
- by Shannon
Is there a way to copy an entire directory, but only the folders? I have a corrupt file somewhere in my directory which is causing my hard disks to fail.
So instead of copying the corrupt file to another hard disk, I wanted to just copy the folders, because I have scripts that search for hundreds of folders, and I don't want to have to manually create them all.
I did search the cp manual, but couldn't see anything (I may have missed it)
Say I have this structure on my failed HDD:
dir1
files
dir2
files
files
dir4
dir3
files
All I a want is the directory structure, not any files at all.
So I'd end up with on the new HDD:
dir1
dir2
dir4
dir3
Hoping someone knows some tricks!