You are not logged in.
Pages: 1
Today I wondered how to empty the trash bin from CLI (just for fun
), I googled it and found
rm-rf /home/USER/.local/share/Trash/files/*
rm-rf /home/USER/.local/share/Trash/info/*fine, that works.
I have also found something more, a little program called trash-cli. 
It does more that just emptying the trash, it provides a "mild version of rm command". Files and/or folders, instead of being just deleted with rm, can be moved into the trash bin and even restored from CLI, the same way it is done in Thunar, cool! 
So, first install the dependencies:
sudo apt-get install python python-setuptoolsThen download the latest sources, unpack and install them
wget https://github.com/andreafrancia/trash-cli/tarball/master
tar xfz andreafrancia-trash-cli-xxxxxxxx.tar.gz
cd andreafrancia-trash-cli-xxxxxxxx
sudo python setup.py installand finally use it.. 
(the examples are taken directly from the author's README)
$ trash-put foo
$ trash-list
2008-06-01 10:30:48 /home/andrea/bar
2008-06-02 21:50:41 /home/andrea/bar
2008-06-23 21:50:49 /home/andrea/foo
$ restore-trash
0 2007-08-30 12:36:00 /home/andrea/foo
1 2007-08-30 12:39:41 /home/andrea/bar
2 2007-08-30 12:39:41 /home/andrea/bar2
3 2007-08-30 12:39:41 /home/andrea/foo2
4 2007-08-30 12:39:41 /home/andrea/foo
What file to restore [0..4]: 4
$ ls foo
foo
$ trash-empty
$ trash-empty <days>I hope someone will find it useful!
VDP76
EDIT:
- The program is availabilities through repositories for Waldorf, so the install is just
sudo apt-get install trash-cli- The README file states that the program requires Python 2.7, which is not available in Statler, so I tested it in a Waldorf virtualbox and it worked well! However debian repositories indicate compatibility also with python 2.6 and indeed the program works also in Statler! 
Last edited by VDP76 (2012-07-10 19:09:27)
We are a nice, friendly community here and I hope we stay that way.. 
Offline
Very cool, @VDP! Thanks for sharing! 
Last edited by elvaqueroloco (2012-07-10 02:29:31)
To say that any people are not fit for freedom, is to make poverty their choice, and to say they had rather be loaded with taxes than not. - Thomas Paine
Offline
The program is written in python and requires a version higher than 2.7 so I couldn't try it in Statler, but I tested it in a Waldorf virtualbox and it worked well!
VDP76
In Statler, apt-get python3 (or whatever you need) and change the first line of the script to
#!/usr/bin/python3or
#!/usr/bin/env python3 I used to run 3 different python versions with Statler
Artwork at deviantArt; Iceweasel Personas; GDM #! Themes;
SLiM #! Themes
Offline
Thanks guys!! I am glad to have contributed! 
@damo It turned out that the program is compatible also with python 2.6 (see the edit in the first post), anyway thanks for the suggestion.. 
We are a nice, friendly community here and I hope we stay that way.. 
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.