Advertisement

How To

Help! I can’t empty the trash on my Mac

Cyril Roger

Cyril Roger

  • Updated:

TrashThis has surely happened to you at least once: after pressing CMD+Delete on an item or selecting ‘Empty Trash’ in the Finder the following message pops up: “The operation could not be completed because the item ‘(item name)’ is locked.” If your trash is filled to the brim with files, then you don’t really want to go rummaging through it, removing the locked ones and opening their info page one by one just to unlock them. That could take ages and be incredibly tedious.

You can fortunately repair all files at once…using the Terminal. You may have noticed I’ve been frequently posting on the Terminal. It’s not the sexiest program on Mac OS, but it’s pretty effective, even in today’s age of the sleek new Leopard. For this particular issue, it’s probably the best tool around.

Anyway, here is how to proceed. Open up your Terminal in Utilities and type chflags -R nouchg Then open up the Trash to show all its contents. Select all items in the trash (CMD+A is the quickest way) and drag them to the Terminal window. Here you are not sending all the files to the Terminal, you are just adding their pathname to the Terminal, so it knows where the files you want to erase are located (this trick actually works whatever the command you want to perform in the Terminal, and it’s often much quicker than typing up the full path to a file). Then press Return, close the Terminal and empty the trash. All your files should by now have been deleted.

If removing very large files (over 1GB)  is what’s worrying you, then check out an earlier post on the subject.

[Via: Apple]

Cyril Roger

Cyril Roger

Latest from Cyril Roger

Editorial Guidelines