UMBC logo

« Why do E-mails Bounce? | Main | Summer 2006 Course Shells Created on 5/18 »

April 26, 2006

Tiger Tip: Deleting Locked Files

You may occasionally find that you are unable to delete files because they are marked as being locked. You may be unable to drag a file to the trash, or unable to empty the trash. Under earlier versions of the Mac OS, you could hold Option when selecting the Empty Trash command, and Mac OS would delete locked files. Under Mac OS X, do the equivalent by holding Option and then clicking and holding the mouse button over the dock’s Trash Can icon. In most cases, this deletes any locked files that are already in the trash. However, this doesn’t help if you can’t move the locked file into the trash in the first place.

To unlock a file in Mac OS X, select the file’s icon and select the Finder’s Show Info command (or press the CMD+I hot key combination). This displays the Finder’s General Information dialog box.

If the checkbox beside the Locked entry is selected, deselect it. Now you should be able to delete the file or empty the trash.

If the Finder displays a dialog box indicating that you do not have permission to unlock or modify the file, use the OS X Terminal application and the sudo command to unlock and delete the file. Start the Terminal and change to the directory where the file is located, then issue the command:

sudo chflags noschg,nouchg filename

Replace filename with the name of the file that you want to unlock. Now you should be able to delete it.

|