Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chowmainia

macrumors newbie
Original poster
Mar 13, 2008
2
0
Problem:
I have a folder with numerous subfolders, each containing numerous files that i would like to batch unlock (vs tediously unlocking each individual folder).

failed attempts involve:
- tried the following terminal action: sudo chflags -R nouchg ( as suggested on this website (http://docs.info.apple.com/article.html?artnum=106237) but it did not work.
I did not try the other suggestions on the website because it started getting really complicated and i was afraid to do something that may cause damage/delete my files
- tried unlocking the folders and subfolders, however each individual file within the corresponding folder/subfolders remained locked

Partial but suboptimal solutions tried:
- i found a partial but not optimal solution to my problem on this site:
https://forums.macrumors.com/threads/366864/
however, the option-command-I will only allow me to unlock files each subfolder at a time (as i need to actually highlight the files themselves).
is there a way where i could just unlock all the folder/subfolders/files within an entire directory in one fell swoop?

My system:
- the new MBP running Mac OS X 10.5.2

i am a new mac user and i apologize in advance if there is some simple solution to this problem that i have yet failed to discover, but any help would be greatly appreciated

thanks
 
Problem:
the option-command-I will only allow me to unlock files each subfolder at a time (as i need to actually highlight the files themselves).
is there a way where i could just unlock all the folder/subfolders/files within an entire directory in one fell swoop?

My system:
- the new MBP running Mac OS X 10.5.2

i am a new mac user and i apologize in advance if there is some simple solution to this problem that i have yet failed to discover, but any help would be greatly appreciated

thanks

Time for some serious finder mojo:

1. Using Finder, the top level folder of those files that you want to unlock. Switch to List View mode (cmd-2).
2. You should now see a finder pane containing only those files and folders that you want to unlock.
3. Cmd-a to Select All.
4. Open all the sub-folders. With all selected, opt-command-right arrow to open up alllll the children.
5. Cmd-A to select all
6. Opt-Cmd-I to bring up the single pane inspect
7. Unlock
8. See my keyboard navigation guide for more Finder mojo
https://forums.macrumors.com/threads/452390/
 
thank you!!

thank you mason.kramer!!!
this is exactly what i was looking for, and it works beautifully!!!
i had over 24000 files to unlock so of course i had the spinning beach ball for about 15 min in order to complete the unlocking task.

thanks again
 
Mason is MacGod

I'm a few months late, but found this thread. I am a Brand New Imac User after being strapped to a PC for the past 18 years. Was trying to clean up files etc. by moving, copying, trashing etc. and ended up with many many gigs of locked files in my trash which wouldn't budge ....... I am not at all familiar with "locked" files. Moral of the story is, Mason's tip rocks ! My wrist was getting very sore going one by one.

Lots to Mac-Learn for me !
 
i'm new to mac too and last week i made huge data transfer from my old PC via wlan (i cable access didn't work :confused:)
now i got many gigs of locked files and subfolder of unfinished projects i would like to work on....
i've tried to use select all/get info method but it doesn't work on mixed content - most of it is locked and some (don't know which) i've unlocked manually...
i also tried locker 1.0 which doesn't work on leopard and locker 1.1 which is widget for locking user account :(
now i really miss explorers "apply to subfolders"...
could someone, please help?
thanks!
 
Terminal command.

Find Terminal.app in /Applications/Utilities/Terminal.app (or use Spotlight from the upper right:
27eaa696119a50ff02735b619638166f.jpg
)

Replace /PATH/TO/UNLOCK with the path of the top directory that needs to be unlocked in the line of code below. Then copy the modified command to your terminal and press enter to run it. One thing, if you don't have permission to write the files that you're unlocking, you have to prepend "sudo" to the command and enter an administrator's password.
export UNLOCK="/PATH/TO/UNLOCK"; find $UNLOCK -type f -exec setfile -a l {} \; find $UNLOCK -type d -exec setfile -a l {} \;

find is a command that walks through your file hieararchy and applies an expression to each file. setfile is a mac os x application that gets the job done when it comes to files.

Good luck let me know if that fixed it for you.
 
  • Like
Reactions: mlewin
Was having the exact same problem...

Very annoying, after I brought a bunch of files over to my MacBook from a Windows box.

I Googled around, and stumbled across BatChmod, available here, which made really short work of the issue, and was super easy to run. And I'm definitely not a technical guy either, so I didn't both trying any of the Terminal-related fixes...

Good luck!

Cheers,

T.
 
Easy answer

Open a terminal and navigate to the top of the directory structure for which you would like to change the file lock status (mode).

Run the following command:

chmod -R 777 .
 
Basic Solution to batch unlock multiple files

The first post above by mason.kramer is great if you dont want to type commands. However if you want to unlock many files ie hundreds or thousands, you may find it difficult to achieve.

In step 5 try by breaking down to say 400 files in a group of folders at a time.

Do step 6.

In step 7 if the Locked/Unlocked box shows a minus, click the box several times quickly until it goes blank (no minus & no tick). Once its blank - wait... all locked files selected should unlock.

Hope this helps. I spent days finding this solution.

MBP 2011 Lion
 
Last edited:
Open a terminal and navigate to the top of the directory structure for which you would like to change the file lock status (mode).

Run the following command:

chmod -R 777 .

Isn't that a little dangerous? I've tested this with individual files and there is no correlation between the unix-level file permissions and the Mac OS "Locked" flag on each file. Your suggestion would effectively remove all file level security from the affected files, and would NOT actually clear the "Locked" flag.

I tried Mason's post and it definitely works. However, it takes the computer a while to enumerate files in the Finder when you use the opt-cmd-right arrow, but it's worth the wait. Thousands of files unlocked after a few minutes waiting for Finder to catch up - well worth it!
 
Isn't that a little dangerous? I've tested this with individual files and there is no correlation between the unix-level file permissions and the Mac OS "Locked" flag on each file. Your suggestion would effectively remove all file level security from the affected files, and would NOT actually clear the "Locked" flag.

I tried Mason's post and it definitely works. However, it takes the computer a while to enumerate files in the Finder when you use the opt-cmd-right arrow, but it's worth the wait. Thousands of files unlocked after a few minutes waiting for Finder to catch up - well worth it!

I concur with Mason's post - an excellent keyboard tip, it saves a clickfest.

One snag: finder is claiming there are still some locked files, but I can't see any (nor can finder find the files it claims are there). Hidden files? I can't seem to find a way to unhide files, so I can unlock them and delete them, sigh... :(
 
II can't seem to find a way to unhide files, so I can unlock them and delete them, sigh... :(
To show hidden files in Finder, enter the following two commands into a Terminal window (press enter after each line):
defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder​
To hide hidden files in Finder, enter the following two commands into a Terminal window (press enter after each line):
defaults write com.apple.Finder AppleShowAllFiles FALSE
killall Finder​
 
Many Thanks

Just came across a need to do this exact same thing after adding two, 2 TB drives to my Mac Pro. Doing a lot of file management and have a lot of locked files. Many thanks!
 
Time for some serious finder mojo:

1. Using Finder, the top level folder of those files that you want to unlock. Switch to List View mode (cmd-2).
2. You should now see a finder pane containing only those files and folders that you want to unlock.
3. Cmd-a to Select All.
4. Open all the sub-folders. With all selected, opt-command-right arrow to open up alllll the children.
5. Cmd-A to select all
6. Opt-Cmd-I to bring up the single pane inspect
7. Unlock
8. See my keyboard navigation guide for more Finder mojo
https://forums.macrumors.com/threads/452390/

Very helpful guide as I had 500 stills to unlock. Thank you.
 
Time for some serious finder mojo:

1. Using Finder, the top level folder of those files that you want to unlock. Switch to List View mode (cmd-2).
2. You should now see a finder pane containing only those files and folders that you want to unlock.
3. Cmd-a to Select All.
4. Open all the sub-folders. With all selected, opt-command-right arrow to open up alllll the children.
5. Cmd-A to select all
6. Opt-Cmd-I to bring up the single pane inspect
7. Unlock
8. See my keyboard navigation guide for more Finder mojo
https://forums.macrumors.com/threads/452390/

Awesome !!! Thanks so much. This still works great in el capitan.
I just reinstall el capitan and copy files from time machine and suddenly all my files got locked.
So yeah this is very much solve it.
 
Very helpful guide as I had 500 stills to unlock. Thank you.
[doublepost=1454084436][/doublepost]i am using el capital and i went through the steps suggested to unlock batch folders/files by mason but no unlock option was made available in the info pane. what am i missing?
 
Easy answer

Open a terminal and navigate to the top of the directory structure for which you would like to change the file lock status (mode).

Run the following command:

chmod -R 777 .

Uhm, no.

First off, 777 means read write execute for user owner, group owner, and world. You're never going to do that ever. Even if you think you need to make a file rwx'ed for world, there's a better way to ACL.

Second, Unix file permissions do not affect the 'Locked' flag of a file in OS X. Flags are part of the BSD and OS X filesystem extension and should be modified via chflags.
 
That's not the post being discussed. ocabj quoted realet, not mason.kramer, which Tankmaze responded to.

oh sorry. how do i unlock batch folders as those instruction from mason.kramer not giving me an unlock option in the info pane
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.