There are three kinds of permissions that a user can have for a file:
There are three categories of users who may have different permissions to perform any of the above operations on a file:
Files are given an owner and group when they are created. Usually the
owner is the current user and the group is the group of the directory
the file is in, but this varies with the operating system, the
file system the file is created on, and the way the file is created. You
can change the owner and group of a file by using the chown
and
chgrp
commands.
In addition to the three sets of three permissions listed above, a file’s permissions have three special components, which affect only executable files (programs) and, on some systems, directories:
In addition to the permissions listed above, there may be file attributes specific to the file system, e.g: access control lists (ACLs), whether a file is compressed, whether a file can be modified (immutability), whether a file can be dumped. These are usually set using programs specific to the file system. For example:
On GNU and GNU/Linux the file permissions
(“attributes”) specific to
the ext2 file system are set using chattr
.
On FreeBSD the file permissions (“flags”) specific to the FFS
file system are set using chrflags
.
Although a file’s permission “bits” allow an operation on that file, that operation may still fail, because:
For example, if the immutable attribute is set on a file,
it cannot be modified, regardless of the fact that you
may have just run chmod a+w FILE
.