May 06

You can change file permissions with the chmod command. In Unix, file permissions, which establish who may have different types of access to a file, are specified by both access classes and access types. Access classes are groups of users, and each may be assigned specific access types. The access classes are “user”, “group”, “other”, and “all”. These refer, respectively, to the user who owns the file, a specific group of users, the other remaining users who are not in the group, and all three sets of users. Access types (read, write, and execute) determine what may be done with the file by each access class.

There are two basic ways of using chmod to change file permissions:

Symbolic method

The first and probably easiest way is the relative (or symbolic) method, which lets you specify access classes and types with single letter abbreviations. A chmod command with this form of syntax consists of at least three parts from the following lists:

Access Class Operator Access Type
u (user) + (add access) r (read)
g (group) – (remove access) w (write)
o (other) = (set exact access) x (execute)
a (all: u, g, and o)

Continue reading »

written by MG \\ tags: , , ,