Tag Archives: terminal

Recursively unlock files on Mac OS X

I copied some songs from a CD and ended up with a folder full of locked files. iTunes can’t save changes to song info (ID3 tags) until I unlocked them. How can you unlock files recursively on Mac OS X?

If you have a folder full of locked files on Mac OS X, you can quickly unlock all of them recursively with the following command. Open a Terminal, go to the folder containing locked files, and type:

chflags -R nouchg *

An excellent introduction to chflags on Mac OS X Hints. Here’s an excerpt:

In addition to the standard UNIX permissions (read, write, execute for owner, group, other), OS X has a few flags that can be set on files and folders to make them locked.

These flags supersede the standard UNIX permissions. If a file is locked, that overrides the write permissions so that applications treat the file as read-only. If a folder is locked, no files can be added or removed from that folder, no matter what the write permissions on the folder are. These restrictions apply to all users, independent of the permissions that are set on the files or folders. They even apply to the root user (or to admin users using sudo).

Read more about chflags at Mac OS X Server FAQ.

HTH!