Locking and Unlocking a file in macOS from the cli

To lock the file: chflags uchg {file path}

To unlock the file: chflags nouchg {file path}

Keywords: lock, unlock, command line, Terminal

This article was updated on 2023-01-25

I'm nabeards. I'm a full stack JavaScript developer. I travel full time, a.k.a., Professional Wanderer, a.k.a., Digital Nomad.