united states of america usa  linkedinfacebookgoogle

Unlocking locked files in Mac OS

Let's say you are trying to change the permissions of some files (using chown or chmod), but you get an error:

Operation not permitted

Apple and Mac IT SupportThis is (in most cases) because the files are locked (you can verify that by going to "Get Info" for each file or directory). One way to solve it is to go through the list of permission errors and manually unlock them using Finder. A quicker way is to do it on a command line:

chflags -R nouchg /Users/macmac/Documents

This will allow all files in the directory "Documents" to be changed. You can then run chmod or chown on "Documents" and will not receive the error.

Options description for chflags:

-R = recurse into directories (careful with this option, because you will change everything underneath it)
nouchg = allow for file/directory to be changed

chflags -R nouchg 

Tel: (786) 646-6461   |   Toll-Free: (877) 454-0758
18350 NW 2nd Ave, Ste 406E | Miami, FL33169