Lock & Unlock Files with the Terminal

For some reason, OS X has a concept of "locked file". You can lock a file (or directory) by selecting its info screen (CMD-I or File->Info) and then clicking Locked button. Locked file is hard to remove (either rm or move to trash).

To lock or unlock a file in terminal, use chflags command. To lock, use

$ chflags uchg filename

and to unlock, use

$ chflags nouchg filename
 
For some reason, OS X has a concept of "locked file". You can lock a file (or directory) by selecting its info screen (CMD-I or File->Info) and then clicking Locked button. Locked file is hard to remove (either rm or move to trash).

To lock or unlock a file in terminal, use chflags command. To lock, use



and to unlock, use

THANKS a lot!!!
 
Back
Top