In the category of scripts to clean up computers, here is a one-liner for removing all files but leaves the directory structure intact.
I found this to be very useful for companies that have a network share where every user has it’s own directory but company policy states that all files will be deleted from that share in the weekend.
ls -recurse | where {!@(ls -force $_.fullname)} | rm –whatif
Big fat note: Executing this on a drive will remove all files… also on the system disk if executed on that drive!!!

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 