Basic Unix Notes

file premissions

Basic permissions and what they mean

r - read access. w - write access. x - execute access. These file permissions are grouped in a set of 3. The first being the owner's, followed by the group's, and last the other's (or world). If you are the owner, then you always have access to the file. If you are in the group, the group access is used, even if the world access is less restrictive. For example if a file has rwx---rwx and it is the same group as your are, you will not have access to it, even though world has access to it.

On a Directory

r--

read access: Allows files in this directory to be listed, but does not show file attributes [size or shape:-)].

-w-

read access: Allows files in this directory to be created or written (if file permissions allow).

--x

read access: Allows execution of programs in this directory (if file permissions allow).

r-x

read and execute: Allows full listing (ls -al) and execution of files in this directory. Does not allow creation of new files, but does allow modification of existing files.
rw- read and write: Allows reading and writing and creating files into this directory.
-wx write and execute: Allows execution and writing and creating of files in this directory.
rwx read, write, and execute: Allows reading, writing, and execution of files in this directory.

On a file

r--

read access: Allows file opened in read mode.

-w-

read access: Allows file to be writen to and deleted

--x

read access: Allows execution of programs that are in this directory.

r-x

read and execute: Allows full listing (ls -al) and execution of files in this directory.
rw- read and write: Allows reading and writing and creating files into this directory.
-wx write and execute: Allows execution and writing and creating of files in this directory.
rwx read, write, and execute: Allows reading, writing, and execution of files in this directory.