Ubuntu – How do you access an external USB hard drive and empty its Trash folder

deletehard drivelubuntutrash

I am fairly new to Linux, Ubuntu, etc,
I am running lUbuntu 18.04.5.
Please note that I need to be given explicit instructions whenever I have to use Terminal (command line).

With my being so inexperienced and unfamiliar, I do not know how to empty the Trash folder on an external USB HDD (which I have been using for backing up my home folder).

I can see the Trash folder (which is called .Trash-1000) in the external USB HDD, using the GUI of the file manager for lUbuntu (which is called PCManFM). However, I do not see any way to empty the trash folder using PCManFM.

I am willing to use Terminal to empty the Trash folder, but I would need explicit instructions.

Best Answer

You can add this missing feature in LXDE, emptying the trash can using a menu thanks to the file manager actions, the easy way (it should be compatible with all versions of PCManFM except maybe Qt based builds, for now). Just open a LXTerminal and use these five commands:

sudo apt-get install trash-cli

mkdir --parents $HOME/.local/share/file-manager/actions

wget -O $HOME/.local/share/file-manager/actions/ask-trash-empty.desktop https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/lubuntu/trash-empty/ask-trash-empty.desktop

sudo wget -O /usr/local/bin/ask-trash-empty https://raw.githubusercontent.com/NicolasBernaerts/ubuntu-scripts/master/lubuntu/trash-empty/ask-trash-empty

sudo chmod +x /usr/local/bin/ask-trash-empty

enter image description here

Now re-log in again, and that’s all.

This is just a copy/paste from https://lubuntu.me/pcmanfm-empty-trash-menu/, so all thanks should go to RedWolf

Note: A user at the Lubuntu site also mentions in comments (which I can't test as I already have zenity installed)

"You first need to install zenity (sudo apt install zenity)