Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use OS X's trash in a Finder-like way from Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use OS X's trash in a Finder-like way from Terminal
Authored by: Anonymous on Apr 23, '10 08:26:17PM

osx-trash (Rubyforce project page) is a much nicer way of trashing files from the command line.. "It uses AppleScript via Scripting Bridge on top of to communicate with the Finder", so deletes files exactly like Finder.

To empty the trash, you can use a single line of AppleScript:

osascript -e 'tell app "Finder" to empty the trash'

..and as a bash alias:

alias emptytrash="osascript -e 'tell app \"Finder\" to empty the trash'"

[ Reply to This | # ]