Can't unlock folder in 10.2.1

in Genius Bar edited January 2014
Odd problem. Can't unlock a folder in 10.2.1 to trash it, or move it. I have run the fix permissions utility. I used batChmod to change the permissions of the folder to 777, but the lock box is still greyed out, but checked in the get info box. What gives?

Also, in the terminal how do you cd to directories with weird names, such as "abc 02-101 Name & Title Docs"

Thanks. I need to prune my disk, and this folder is driving me nuts!


  • Reply 1 of 5
    In the terminal, if you are using the default tcsh shell, you can use the tab key to autocomplete filenames. To manually escape characters like the space, either put a \\ before each special character or just put quotes around the whole name. So, to cd to that directory, you could use:

    cd "abc 02-101 Name & Title Docs"


    cd abc\\ 02-101\\ Name\\ \\&\\ Title\\ Docs/

    You could also just type "cd " (note the trailing space, but don't use the quotes) in the Terminal and then just drag and drop the folder from the Finder into the Terminal window. That will fill in the name. Just press return after that.

    As for the locked folder problem, I'm not sure what could cause that. Rather than use batchmod, have you tried just using the round lock button in the Finder info window for it? Click the disclosure triangle for Ownership & Permissions and you'll see it. From there, try changing the owner to your user (Me) and see if you can then unlock it.

    Worst case, you could use "sudo rm -Rf /path/to/folder/name" in the terminal to delete it. Be extra careful with this command, though, because it will permanently delete whatever is at the path you give it.

    [ 09-25-2002: Message edited by: Brad ]</p>
  • Reply 2 of 5
    defiantdefiant Posts: 4,876member
    [quote]Originally posted by browncow:


    Also, in the terminal how do you cd to directories with weird names, such as "abc 02-101 Name & Title Docs"


    exactly as you wrote it. with "" .
  • Reply 3 of 5
    Thanks for the valuable terminal lesson. The sudo rm -Rf did not work unfotunately. The odd thing is that when I get info on the folder in question, the "Locked" checkbox is locked, but greyed out.

    When I use the sudo rm -Rf /path/to/folder, it lists all of the files within the folder with : Operation not permitted after it.

    Yes, I am using an admin account, and yes I have tried removing each individual file in this manner, with no success. Any other ideas, from the friendly Unix fiends out there?
  • Reply 4 of 5
    Actaully, I have an idea that would require booting into single-user mode to fix.

    I once somehow accidentally locked a file in a way that *nothing* could delete it. I can't remember exactly which flag it was, but it was set so the only way it could be deleted was through the single-user mode prompt.

    update: okay, it's called the system immutable flag. When this is set, absolutely nothing can remove the file under normal circumstances, even the admin or "root" user. I can't recall how to get info on the file to see what flags are set for it, though.

    Anyhow, to get rid of such a flagged file or folder, you have to reboot into single-user mode. To do this, restart your Mac while holding the apple and 's' keys. When you're dumped into a text console, you can release the keys.

    Before you can do anything to your drive at this prompt, you first have to check it and mount it. To do this, enter the command:

    /sbin/fsck -y

    It will check scan your disk for errors. If you get a message that reads "**** FILEYSYSTEM WAS MODIFIED ****" then you should run it again just to be safe. When it says the disk is okay, enter the command:

    /sbin/mount -uw /

    That will mount the drive and start you at the top. From here, you can "cd" into all your directories until you find what you need to delete. Be careful that you don't modify or delete anything else, because you're essentially logged in as the all-powerful "root" user (or super-user) here. Anyhow, one you find the folder, use that command we gave you above:

    rm -Rf "name of folder"

    You don't need the "sudo" part because sudo just authenticates you as a super-user. That's redundant here single-user mode already puts you as the super-user.

    When finished, you can continue booting up normally by entering the command:


    Did you follow all that? I understand that this is probably pretty overwhelming to someone that isn't comfortable with the entire unix side of OSX yet. If you've got any questions about this process, don't hesitate to ask. I don't want to risk you doing something you're unsure about and then accidentally messing up something else.

    Best of luck!

    [ 09-26-2002: Message edited by: Brad ]</p>
  • Reply 5 of 5
    torifiletorifile Posts: 4,024member
    Wow, that's the first I've heard of a "system immutable" file. What are the settings on it? How in the world did you do it (so I can avoid it)?
Sign In or Register to comment.