[plug] For those backing up Other OS boxes or running a samba share

Tim White weirdo at tigris.org
Mon Oct 18 14:19:27 WST 2004


For those that don't already know, windows(And OS X) leave behind many 
different system files. One that windows leaves behind is Thumbs.db 
which contains thumbnails of the pictures in that directory. Mac leaves 
behind many . files which won't normally annoy you. When I browse 
through picture directorys that have been on a samba share or windows 
box I see many Thumbs.db files just wasting space being annoying (At 
least Linux hides ALL the thumbnails in its own location that everything 
users.)
Well to cut to the chase. If you want to rm these files easily then I am 
going to share what I've learnt.
Basically you need permission to view and rm files on the 
drive/directory/share that your going to run this. You create a regex 
for the file/s you want to remove and then place it in the command below 
where I have Thumbs.db. It can take a normal regex and only matches on 
the file name so not its parent directorys. You then run it in the base 
directory of the are you want to clean, depending on your settings rm 
may or may not prompt you to delete the files. You can play with that 
your self. It will tell you any that it couldn't delete and I'm sure a 
-v on the end will make it tell you those it deletes as well. I was 
tempted to script it once a long time ago but have since learnt the Unix 
way. Hope this helps someone else.

find -name Thumbs.db -print0 | xargs -0 rm

(The -print0 and -0 get around the escaping of special characters issue)
Tim



More information about the plug mailing list