BSD file flags

Mac OS X being a BSD derived Unix, it inherits some of its security features, many of those are not advertised and a such not widely known. One such feature are file flags. Those flags can be used to specify additional properties for certains files, for instance that the file is immutable, or that a directory can only be appended to (i.e you can add files, but not remove them). The immutable flag is actually used by the Finder to mark a file as locked.

You can see the flags of a file by adding the option -o to the ls command. The actual flags can be manipulated using the chflags command.

One thought on “BSD file flags

  1. On linux, if you have a filesystem that follows the VFS standard, you can use attributes to do this. With ext2/3, the command is “chattr” to edit them, and “lsattr” to list them.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: