How to Lock Files and Folders in Mac OS X

Aug 11, 2010 - 8 Comments

Finder icon on the Mac

You can easily prevent changes being made on any files or folders in Mac OS X by locking the file or folder in question. This locking capability will also prevent the file or directory from being deleted, since the Trash will not empty while a file is in a locked state.

Locking files and folders in Mac OS X is quite easy, and the process is the same in all versions of the Mac operating system.

You’ll obviously want to know the file(s) or directories you wish to lock down ahead of time, then proceed with the following instructions.

Locking a File or Folder on the Mac to Prevent Changes & Deletion

  1. Select the file or folder you want locked from the Finder of the Mac
  2. Go to the File menu and choose “Get Info” (or hit Command+i)
  3. Look under ‘General’ and click the ‘Locked’ checkbox so that it’s selected, this will lock the file
  4. Repeat for other files and folders as necessary
  5. Close the Get Info window when finished

The files or folders will now be locked, preventing any changes from being made to the file.

lock file to prevent changes

If a file or folder is locked, it will also cause an alert dialog to popup if you try and delete it, saying “Item ___ is locked. Do you want to move it to the Trash anyway?”

Note this locks the file from changes and removal, but it does not password protect a file or folder like this image trick does.

Finder

Unlocking a File or Folder in Mac OS X

You can unlock a file in Mac OS X by reversing this process.

Just return to the Get Info section for a chosen file, and by unselecting the checkbox next to “Locked” through the same Get Info panel you will unlock the file.

Do note that if you are trying to unlock a file that you do not have privileges to you will need the admin password for that Mac.

Once the file is unlocked, it can be modified or deleted again.

.

Related articles:

Posted by: Paul Horowitz in Mac OS, Tips & Tricks

8 Comments

» Comments RSS Feed

  1. danielelpaisano says:

    lock unlock multiple files,
    select all files or folders
    select cmd+option+i
    in the info dialog box select lock or unlock
    all files will be locked or unlocked
    also possible for “hide extension” or not
    the type of keyboard can make this tricky (querty-azerty),
    in that case use a virtual keyboard

  2. Dean says:

    Locking the file/folder will prevent changes, but if it is deleted, a message will appear saying that “it is locked, do you still want to move to trash?” You can then empty the trash and your locked file/folder will be gone.

  3. Derek says:

    When I lock a folder on my desktop, I am unable to drag files into it or save files to the folder. This is very strange. I want the folder locked so that I don’t accidentally delete it, but I obviously want to still be able to save files to it. Does anyone know why I’m having this issue? I am unable to find an answer. Thanks.

  4. Peter says:

    If i lock an folder on external disk by this way and i will get an encrypting virus, will it encrypt the folder as well? Under admin user…

  5. bramofon says:

    This only prevents changes being made to the file.

  6. bijan says:

    Reversing the process does not work for unlocking in Snow leopard. I have even rebooted the laptop and still cannot unlock the folders and files.

    Can anyone help me?

    Thank you

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site