The Finder lets you lock files, but some aspects are a little obscure.
File locking has a long tradition in computing: you or independently running software wants to make sure that a file isn’t modified or deleted when it’s needed or in use. Because macOS is Unix based, it offers file-level permissions flags that control how a file can be manipulated and by whom.
But macOS has long had a separate way to lock a file from the Finder that also prevents it from being modified, deleted, or rename from the Terminal or other apps. Lock, unlock, and status commands are also available via the command line in Terminal.
(Note that Finder-oriented locking is entirely different from setting a file to read-only permission either in the Finder or via the Terminal, which involves changing Unix permissions. I recommend not using read-only status for files and folder you work with in the Finder and via apps, as the Finder doesn’t honor those permissions for files that are assigned to you in macOS via Unix permissions, which typically includes everything in your home directory.)
Lock and unlock via the Finder in macOS Big Sur
Turning the lock on and off in the Finder is incredibly simple. Select one file or folder and choose File > Get Info; or select multiple files or folders and hold down Option while choosing File > Show Inpector—the Option key opens a single Get Info window for the multiple items called Multiple Items Info. A Locked checkbox can be selected or deselected. It shows a – (dash) if the items selected are in a mixed state of being locked and unlocked; clicking will lock allthe files.
Read more at MacWorld.com
