Last Updated: February 25, 2016
· jinnko

Find locked files in OSX terminal

Locked files in OSX can't be removed with the traditional rm. The Finder does offer a "Lock" checkbox, however this is very inconvenient to use on a large number of files.

In the Terminal it's possible to identify the locked files with the following command:

find . -type f -flags +uchg

The uchg flag comes from chflags and represents the "user immutable" flag, which corresponds to the SetFlags -a (l|L) option.