Monday, January 02, 2012

Empty Trash from Command Line in Ubuntu 11.10

Though we are so fond of GUI but still there are a few who just love being in the terminal forever and perform all our common tasks from the terminal itself that most of GUI lovers love to do graphically.

To empty our trash from terminal through command line, first of all we need to know the path to our trash and after that everything is just easy.
The 'Trash' to our 'Home Folder' normally resides in /<Home Directory>/.local/share/Trash/
This 'Trash' folder contains three directories expunged, files and info. They are not much of our concern.

So to empty the trash you can fire the below command
rm -rf ~/.local/share/Trash/

This will immediately delete your 'Trash' from terminal. That's really quick.

Note: You should be very careful while using 'rm -rf' as it deletes the files and directories permanently like a Shift+Del in Windows.

1 comment: