schg
Schg is a reference to the system immutable file attribute used on some BSD-derived Unix-like operating systems. It is not a file type or extension, but a flag that can be set on a file or directory to influence how the system treats it. The schg flag is one of two related immutable flags, the other being uchg (user immutable). The distinction allows administrators to enforce protection at different levels of privilege.
When the schg flag is set, the file or directory is treated as immutable by the system.
The flag is managed with the chflags utility. Examples:
- Set: sudo chflags schg filename
- Clear: sudo chflags noschg filename
For the user-immutable counterpart, use:
- Set: sudo chflags uchg filename
- Clear: sudo chflags nouchg filename
Flags can be inspected with listing commands that show file attributes, such as ls -lO or ls
Schg is supported on BSD-derived systems including macOS and FreeBSD. Linux uses a different mechanism for
chflags, uchg, nouchg, schg in the context of BSD file attributes.