3.2 Symbolic mode
In the symbolic mode, permissions and ownerships are both represented as characters:
- u: the user owner.
- g: the group owner.
- o: the others.
- a: all owners (user, group and others).
- r: read permission.
- w: write permission.
- x: execute permission.
- X: traverse directory.
- t: sticky bit.
- s: set user ID or group ID.
A “mode” consists of a list of at least own owner (user, group or others), an action, and an optional permission
list.
Examples:
- chmod u+x file
Adds execute permission to the user ownher.
- chmod o-w file
Removes write permission from the others.
- chmod og=rx file
Sets others and group owner to read and execute permissions.
- chmod -R g+X dir
Recursively adds directory traverse permission without adding execute permissions to normal (non-directory)
files.
- chmod u+s file
Adds set user ID to file. Anyeone who can execute file will do so as the user owner. This is very dangerous,
especially if the user owner is root!