Monthly Archive for October, 2005

Page 2 of 2

Remove All Files Without Certain Extensions

I needed to remove all files in a hierarchy of folders that didn’t have certain extensions. I searched the net for a quick & dirty bash script to do this, but all the scripts I found only removed files in the current directory, I needed to remove files in the current directory and child directories. Heres the bash script I came up with.

cd ~/Desktop/targetDir
find . | egrep -v "(\.css|\.html|\.htm)" | xargs rm

Assuming ~/Desktop/targetDir is the root directory you want to remove files from, and you don’t want files ending in .css, .html, or .htm. NOTE: if your file paths contain spaces this command will probably fail/mess something up. I take no responsibility for anything that happens to your computer because of this script. Hopefully somebody might find this useful.

Switching To Dreamhost

Well, I think I finally have given in. Over the next 2 months I will be transferring all my sites over to Dreamhost from Hostm which have been an ‘ok’ host. Dreamhost however currently is having an amazing deal- 80% off of their hosting. Thats just incredible, considering their price is already low at $10/month. A few other things that I like about Dreamhost:

  • SSH access, I used this on a clients Dreamhost account and its pretty sweet.
  • Always improving their services, every few months they add or enhance their service.
  • I like their Kbase, its very nicely set up with ability to post/read comments to articles
  • Their referral program is awesome

I have 97 days to test it out to see if I like it or not. I’ll report back with a mini review once I get a change to tinker with it enough :)