6

So I downloaded a "cracked" version of Minecraft. STUPID, I know and understand the dangers. Anyway, the download put a folder called "minecraft" on my computer. it contained a .png and a .jar file. the folder was locked and ended up buying Minecraft from Mojang. Then came the problem of deleting this file. It told me I didn't have the permissions to delete the file. I used the command:

Sudo nautilus

This managed to move the folder to trash. Now when I go to empty trash it says "ERROR WHILE DELETING". The file doesn't get deleted.... Any suggestions, tips, tricks, etc would be fantastic! :)

jake
  • 63
  • 1
  • 1
  • 4
  • If the anwers below don't help, add the output of `ls -l ~/.local/share/Trash/` – kos May 06 '15 at 09:21
  • Have a look [here](http://askubuntu.com/questions/270006/why-user-should-never-use-normal-sudo-to-start-graphical-application). You should not start graphical applications with sudo. – Pabi May 06 '15 at 09:29

3 Answers3

17

Try this:

sudo rm -rf ~/.local/share/Trash/*

Of course replace the * with the folder that you wish to delete or else everything in the trash will be deleted.

Ron
  • 20,518
  • 6
  • 57
  • 72
  • It worked! I'm fairly new to the linux command line, to clarify and understand rm is remove correct? What is -rf ? – jake May 06 '15 at 09:24
  • `rm` is to remove, `r` stands for recursively delete and `f` attempts to (forcefully) remove the file without confirmation. See more [here](http://manpages.ubuntu.com/manpages/precise/en/man1/rm.1.html). In this particular case this is not much of a problem but in general be **very** careful in using this command. Also if my post helped you, accept it as answer. – Ron May 06 '15 at 09:27
1

First install thunar with

sudo su  
apt-update  
apt-get install thunar

If you come from a VNC client (like mine ) then

xhost + 
sudo thunar

in the filemanager find trash and delete from the folder everything.


Another solution:

sudo mount --bind / /mnt 
sudo ncdu -x /mnt 

Search for the desired file and delete it with the d key.

zx485
  • 2,249
  • 11
  • 24
  • 34
Aurel F
  • 11
  • 1
1

From a Terminal Window run the following:

sudo rm -rf ~/.local/share/Trash/*