Home > Linux > Favourite linux single line command…

Favourite linux single line command…

Whenever you have pesky windows users on your network, your file system on any servers running samba start to gain extra, silly, “Thumbs.db” files.

If you’re like me and hate the things with a vengeance, you can get rid of every single one of them using the linux command line below.

updatedb;for i in `locate Thumbs.db|sed 's/ /\__/g'`;do rm -vf "`echo $i | sed 's/__/\\ /g'`";done;

Update 21 Oct 2009: added for loop with sed commands to safety handle spaces, round brackets and single quotes etc. in the file path

Categories: Linux Tags:
  1. ecigar
    August 23rd, 2009 at 23:11 | #1

    Very nice post. I agree 100%.

  1. No trackbacks yet.