Linuxtipstricks – Just another /linux/blog

May 16, 2009

How to manage Trash can or Recycle bin in Linux Desktop graphic environment

Filed under: user tipstricks — Antonio Portuesi @ 7:31 pm
Tags: , , , , , , , , , , ,

In every modern linux distros (OpenSuSE, Ubuntu, Mandriva, …) we use the graphic environment (GUI) almost all day.

Linux GUIs as Gnome, KDE or Enlightment, have a trash can where your erased files go when you delete them from a Desktop utility.

Now if you want to get rid of that from your console, you have to know that the trash can is only another folder in the file system structure, as you can figure out, and it is located at:

user@pc:~$ $HOME/.Trash

so you can send any file to Trash just moving them to there, as an example, lets suppose you have a file in your home directory called readme.txt and want to move it to the trash can (recycle bin if you prefer)

user@pc:~$ mv $HOME/readme.txt $HOME/.Trash/

Whenever you may want to restore it, just move the same file to the original location or to any other you like, just like the following:

user@pc:~$ mv $HOME/.Trash/readme.txt $HOME/

and you are done.

If you want to clean your trash can/recycle bin, just type this line

user@pc:~$ rm -rf $HOME/.Trash/*

and press enter in your keyboard.

That’s all!

Advertisements

Blog at WordPress.com.