|
|
|
A shell function to make 'rm' move files to the trash
Open Terminal, and edit ~/.bash_profile (this is a script which is run every time you open a Terminal) Just curious: what if you don't use the bash shell?
---
A shell function to make 'rm' move files to the trash
If you're using csh or tsch, add this to your .cshrc or .tcshrc file:
Feel free to call the alias "rmm" or something else that suits you. I understand the argument for doing that, but I'm too lazy to remember a million ways to call the same thing. I have an "ll" alias for "ls -l", and it's one of the WORST things, as I type "ll" all the time, even on accounts/computers. I'd rather have my alias do something instead of having me to have to re-type commands over and over. Even for "rm", as I do not accidentally delete someone else's Desktop very often...
Rewriting for tcsh, etc.
Then you'll have to figure out how to rewrite the function for tcsh, or whatever you do use. :)
Sorry, but I'm not familiar with programming in anything other than Bourne or bash, so I'm not the one to ask about it. Hypert's alias command is a basic step; and it's what I was using before I wrote this function. The added value of the function is in appending the time so you don't overwrite anything already in the trash, and in ignoring arguments (although that's not a big deal between rm and mv). |
SearchFrom our Sponsor...What's New:Hints4 new Hints in the last 24 hoursComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,322 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.22 seconds |
|