Search⌘ K

Unix Permissions

Understand the structure and meaning of Unix permissions strings, learn how to interpret read, write, and execute rights for files and directories, and see how these permissions affect common Bash commands. This lesson guides you through managing access using bitmasks and permission letters for effective file system control.

We'll cover the following...

The Unix permissions string has four parts. The following figure explains their meanings.

The groups utility prints the list of groups that the current user belongs to.

We can imagine the Unix permissions as four separate bitmasks. Each of these corresponds to one part of the table above. Each bitmask is three bits, with one bit for each of r, w, and x. Using this approach, we can represent the “-r--r--r--” string like this:

0000 0100 0100 0100

The Latin letters in the Unix permissions have special meanings. First of all, they match the bits that are set to one. The position of each bit defines the allowed action to the object. We don’t need to remember the meaning of each ...