Unix Permissions
Explore how Unix permissions work for files and directories, including the meaning of read, write, and execute rights. Understand the permission string structure and how it controls access in the Bash environment. This lesson helps you read permission settings and explains required rights for common file system commands to effectively manage access while scripting.
We'll cover the following...
The Unix permissions string has four parts. The following figure explains their meanings.
The
groupsutility 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 ...