If your Mac OS X trash contain any locked files, it won’t allow you to empty trash and provide error message like “The operation could not be completed because the item ‘( file name)’ is locked” Or “There are some locked items in the Trash”.
Delete Locked items in trash
Press and hold the Option key while selecting Empty Trash option.
How to unlock any Files or Folders in Mac OS X
- Right click the file and select “Get Info” option.
- Deselect the check box name “Locked”.
- Now try to delete the file.
If you want to unlock folder, then
- Open Terminal app from (/Applications/Utilities) folder.
- Type this command followed by a space: sudo chflags -R nouchg
- Drag and drop the particular folder you need to unlock into the Terminal window.
- Click Return.
- Enter the password and click Return.