Linux File Attributes Made Easy
Sure, you know read/write/execute, but there is more… much more
If you are an advanced Linux user, you probably know all about file permissions set with chmod
. You can see these permissions when you do an ls -l
and they tell you if you, your groupmates, and the rest of the world can read, write, or execute the file. Old hat.
If you really dig into it, though, there are some extra flags for chmod
you don’t run into as often. There’s even more. Each Linux file has a set of attributes that can cause it to behave in special ways that you rarely see people use. Some of the attribute features depend on the file system you use, so that may account for some of their rarity. However, the commands you’ll use to set and read attributes (chattr
and lsattr
) are rarely seen. So let’s find out about both extended permissions and file attributes.
Extended Permissions
I’m going to assume you know about normal permissions which usually take the form of an octal number (750 for rwxr-x---
, for example, or symbolically like u=rwx,g=rx,o=
. If not, you can find plenty of discussions regarding these features elsewhere, including just plain old man chmod
.
However, there is a fourth digit possible. In reality, numeric permissions like 750 are really shorthand…