What is the shell command to empty the garbage bin under Linux?
Except for the
~/.local/share/Trash trash files for other file systems may be stored in
<mount-point>/.Trash-$(id -u) directories.
If your're running ubuntu there is a helper package to clean all locations
sudo aptitude install trash-cli
To clean the trash in all locations just run:
It should work with any linux desktop environment compliant with FreeDesktop.org Trash Specification. On newer versions, the command may be:
After installing the OS if you haven't deleted/moved anything to Trash from GUI, then the Trash folder under user's directory wont get created at all. So if you search for Trash directory from command line you wont find. Now lets say you move/delete a file into Trash from GUI, that's when the directory Trash gets created and is accessible from command-line. If you restore the file or delete the file permanently either from GUI or from command line the Trash folder still stays and is accessible from GUI and command-line.
command line Trash directory:- "/root/.local/share/Trash" under Trash you got two directories again, one with "files" and one with "info". files :- actual data info :- metadata of the data
Checked this on Centos 6.8
Edit :- the files in the thrash can be either deleted from GUI or by getting into /root/.local/share/Trash/files and remove everything