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

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.

share|improve this 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

2 Answers 2

up vote 21 down vote accepted

You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu.

Move file to trash:

gvfs-trash filename

See the content of the trash:

gvfs-ls trash://

Empty the trash:

gvfs-trash --empty
share|improve this answer
Also visit my gvfs-question. –  Pandya Sep 17 '14 at 14:47

Install trash-cli Install trash-clisudo 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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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