I have been keeping myself quite busy with some other projects, but fear not, the Learning the Terminal series is not dead. Hopefully this will hold you over until I have some time to generate some real content.
Last time, we talked about Terminal and Finder integration. One topic we did not touch upon is how to move files to the Trash from the shell. Perhaps surprisingly, Mac OS does not have a built-in command for trashing files. Sure you can just mv files to the Trash folder directly, but this will not handle name collisions or alternate volumes correctly.
There have been a few attempts at a shell script to mimic the trash behavior, but the best I’ve come across is Dave Dribin’s osx-trash. This version is actually a small ruby program that uses the 10.5 scripting bridge to actually execute the Trash operation through Finder. It works “The Right Way”.
Please see Dave Dribin’s setup and installation directions for more information.
⎋
One Comment
When is my next terminal article?
Post a Comment