Snow Leopard allows users to "Put Back" files that were moved to the Trash from Finder. However, when I do mv <file> ~/.Trash from the command line I don't get the "Put Back" option.

Is there a native command in Snow Leopard that moves a file to the trash while letting me still be able to us "Put Back"?

link|improve this question

feedback

3 Answers

up vote 2 down vote accepted

When you move a file to the trash OS X updates the .DS_Store file inside ~/.Trash with the "Put back" information. (See this question for more details)

In order to update this you would have to also update the .DS_Store file when you move a file to the Trash in Terminal.

link|improve this answer
Thanks. Not what I was hoping for, but it's the truth. – sirlancelot Mar 5 '10 at 21:58
feedback

I recommend installing the Ruby gem osx-trash.

How?

sudo gem install osx-trash

Usage?

Usage: trash [OPTIONS] <file> [<file> ...]
       trash [-e | --empty]
       trash [-l | --list]
Specific options:
    -e, --empty                      Empty the trash
    -l, --list                       List items in the trash
    -h, --help                       Show this message
    -v, --version                    Show version

Manipulate to the Finder's trash.
link|improve this answer
Nice! Though, as it communicates with Finder, trashing files with a wildcard plays the trashing sound for every file. – koiyu Mar 20 '11 at 17:59
feedback

You want the rmtrash program.

You can use it to add items to the Trash as if it was done in the finder.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.