|

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]

Commented

  • ttman21 |
    28/04/09
    ttman21

    Worked like a charm

  • Altayeb Amer |
    15/06/09
    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

  • Callan |
    19/01/10
    Callan

    It said permission denied. Help.

  • Cristy |
    30/04/10
    Cristy

    This worked perfectly!

  • Cristy |
    30/04/10
    Cristy

    Thanks!!

30/09/14
Your avatar