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

By Cyril Roger on 23 July, 2008

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]

Comments

  • ttman21 ttman21

    Worked like a charm

    • Sent on 28 Apr 2009
  • Altayeb Amer Altayeb Amer

    Please help i have Macbook pro (MAC OS X version 10.5.7) i can't empty the Trash, i try (option with empty trash in finder) and the (secure empty trash) but its not working. if i move the files from the Trash to desktop it showing empty. the files is not locked. Please help..... Regards

    • Sent on 15 Jun 2009
  • Callan Callan

    It said permission denied. Help.

    • Sent on 19 Jan 2010
  • Cristy Cristy

    This worked perfectly!

    • Sent on 30 Apr 2010
  • Cristy Cristy

    Thanks!!

    • Sent on 30 Apr 2010
  • Comment

Softonic on Facebook