Thursday, October 27, 2011

Trash-cli : Manage Trash from Command line in Ubuntu Linux

By using a utility named trash-cli you can simply mange Trash from command line  

 The location of Trash folder in old GNOME version is (~/.Trash), in current versions it is in ~/.local/share/Trash. There is two sub folders named files and info. The files folder contains the files deleted and info directory consists of meta data for each deleted file.

First step, install trash-cli utility

$ sudo apt-get install trash-cli

It installs three commands,
1. list-trash to list down the files in trash
2. trash to move the file to trash
3. restore-trash to restore the file to original path


$ trash love.txt      ( move the file love.txt to trash folder)

$ list-trash              (List the contents of Trash folder) 

       2011-10-27 22:46:28 /home/abc/love.txt

 $ restore-trash love.txt   (Restore the file love.txt) 

   0 2011-10-27 22:46:28 /home/abc/love.txt
What file to restore [0..0]: 0  (if there is more than one file list shows 1  2  3 etc)

1 comment:

Thomas John said...


I am Thomas John, representing the website Ubuntu Manual. As the name suggests UM is a site that delivers content related to Ubuntu, its derivatives and related software. We are looking to expand our website and are seeking talented writers familiar with Ubuntu or Linux or similar open source software to include in our community of writers.

We had come across your article on the web and was wondering whether you would be interested in writing for us. We can provide sufficient compensation for your writings and would love to have you as one of our writers.

I will provide you with the rest of the details if you are interested.

Thomas John,
Ubuntu Manual