Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to know if there is a command I can issue in a terminal so I do not classically remove (rm) the file, but instead move it to trash (i.e. Nautilus Move to Trash behavior).

In case there is such a command, I would also be interested in knowing what it is.

Edit: This is not a duplicate of this question. There, the foxus is whether files removed using rm in terminal can be restored -- I'm asking how to put files in the trash can instead of removing them.

share|improve this question

marked as duplicate by Rinzwind, Takkat, Jorge Castro, devav2, nitstorm Nov 6 '12 at 18:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Have a look at this answer. –  Peachy Nov 6 '12 at 8:49
Also a good resource here: webupd8.org/2010/02/make-rm-move-files-to-trash-instead-of.html –  Rinzwind Nov 6 '12 at 8:52

1 Answer 1

up vote 19 down vote accepted

Install trash-cli sudo apt-get install trash-cli

Put files in the trash with trash-put file1 file2

List files in trash trash-list

Empty trash with trash-empty

share|improve this answer

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