Lock & Unlock Files with the Terminal

phule

Registered
Is it possible to lock and unlock files with the terminal and if so, how?
 

artov

Registered
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
 

phule

Registered
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!!!
 
Top