About This
I am Michael Tyson, and I run A Tasty Pixel. I write on a variety of technology and software development topics as I travel around Europe in a motorhome.
-
Subscribe to updates 493 feed subscribers
Follow me on Twitter 965 followers
Our Products
Newsletter
Let us keep you informed about important updates, special offers, and new products. Just type in your email address below and hit enter to sign up!
-
Recent Posts
Topics
Audio Business Career Cocoa Code Data Debugging Demo Design Development Google Graphics Interface iPad iPhone Lifestyle Links Location Loopy Loopy HD Mac Maps Marketing Networking Optimisation PHP Scripts Security Shell Social Comment Software Talkie Talkie-for-Mac The Cartographer Travel Tutorial Twitter Update Utility Web WordPress WordPress Plugins WordPress Themes Workflow XCode




Idiot-proof ‘rm’
After my unfortunate accident, I decided to spend a moment trying to make sure it doesn’t happen again.
Thus, the (semi) idiot-proof ‘rm’ was born:
This is a small script that replaces ‘rm’. Instead of deleting, it moves the files in question to ~/.Trash.
It’ll create a directory structure under ~/.Trash that echoes that of the current working directory, so it’s easy to see where files came from.
Here’s the script:
trash.sh
To use it, save it into a file (I use ~/.trash.sh), then save and set it to executable. Then, open up ~/.bash_profile, and add the line:
alias rm=’~/.trash.sh’
That will automatically be run when you log in. To make it work in the current login, just use:
source ~/.bash_profile
…Or type the alias command straight in.