Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

escogido

macrumors member
Original poster
Jun 10, 2011
74
0
I can't empty my trashon my 2011 MBP, running Lion. I've deleted a 'locked' image file and the trash won't empty it, even though it asks me if I want to just empty the 'unlocked' items or 'everything' I click 'empty everything', but it's still there afterwards. And I can't 'put it back' either to unlock it and then delete it. Restarting doesn't help either, trash still shows the item there. It's a small file, but trash showing crap in it is driving me bananas!! :mad::mad::mad:
 
Do you know terminal commands?

Start the terminal.

Type:

cd .Trash (hit return)
ls -a (hit return)

Can you see the name of the problem file? What's it called?

Type:

sudo rm -f <filename> (return)
(where <filename is the name of the file, in double quotes if the filename has spaces in it>)

Make sure you've typed the filename correctly. sudo rm -f tells the machine to log in as admin and delete files 'with force'. You can damage stuff using this incorrectly.

At this point you should be asked for your admin password. Enter it and hit return.

ls -a (return)

The file should now be gone
 
Last edited:
This belongs more in the OS X forums, instead of the Macbook Pro forums, but nonetheless, it's alright.


I recall a button combination that empties the trash through everything. I think it was like command+Click the Empty Trash button? It might have been shift, I don't remember.
 
Do you know terminal commands?

Start the terminal.

Type:

cd .Trash (hit return)
ls -a (hit return)

Can you see the name of the problem file? What's it called?

Type:

sudo rm -f <filename> (return)
(where <filename is the name of the file, in double quotes if the filename has spaces in it>)

Make sure you've typed the filename correctly. sudo rm -f tells the machine to log in as admin and delete files 'with force'. You can damage stuff using this incorrectly.

At this point you should be asked for your admin password. Enter it and hit return.

ls -a (return)

The file should now be gone

Here's what happened:

Last login: Fri Aug 5 18:11:48 on console
Maxims-MacBook-Pro:~ Maxim$ cd.trash
-bash: cd.trash: command not found
Maxims-MacBook-Pro:~ Maxim$ cd .Trash
Maxims-MacBook-Pro:.Trash Maxim$ ls -a
. .. screen-capture.png
Maxims-MacBook-Pro:.Trash Maxim$ sudo rm -f <screen-capture.png>
-bash: syntax error near unexpected token `newline'
Maxims-MacBook-Pro:.Trash Maxim$

So, I'm getting an error - what's next?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.