Skip to content


Bulk Moving or Deleting “locked” files in OSX

A bit off topic this one, but Google didn’t show up the right answer, so it’s worth putting it somewhere on the web.

I was trying to move a bunch of files in OSX and it seemed that some of them were “locked”. This appears ot be a system flag and can be removed on a single file via the file-info tool. But I’ve got 100’s. There’s a bunch of bad suggestions out there. The information you really need is:

chflags -R nouchg ...path...

via the command line. This will remove the “uchg” (unchangeable) flag from the path, and recurse down. To view the flags on a file or directory use:

ls -lO ..path...

You could use “uchg” if you wanted to bulk-set a whole bunch of files to locked, too.

UPDATE: While this worked on the files, I still could not delete the directories. Even from trash. How weird? As it’s an external drive, I think I’ll just mount in on linux and hose them there.

UPDATE 2: Upgraded to Snow Leopard and the problem went away. yay.

Posted in OSX.

Tagged with .