Emptying the trash or recycle bin can be done by right clicking on the icon and hitting the empty option. Almost everybody is familiar with this behavior but not everybody knows this can also be done from the command line.
Windows
All the contents of the recycle bin is stored in one directory. We just have to clear that directory.
- Open a command prompt (
Start + Rto open the run window) and typecmd. - Type the command:
rd /s %systemdrive%\$Recycle.bin
rdis short for "Remove Directory". The/sparameter takes care of removing directory and files in the directory itself.%systemdrive%is an envrionment variable which contains the drive on which Windows is installed.
Linux
In linux the trash is stored on different locations, it might be ~/.local/share/Trash or some .Trash directories. In the repositories there's a package available which takes care of this task.
- Install the package from the repositories:
sudo apt-get install trash-cli
- Run the command:
trash-empty