Unix basics for web authoring

 

File permissions (adapted from Commonly used Unix commands)

Every Unix file has a set of permissions associated with it that specify who is allowed to use that file and in what way.

There are three kinds of permissions:

  1. A read permission means someone can see what is in the file.
  2. A write permission means someone can change what is in the file, or even remove it.
  3. An execute permission means someone can run (execute) a file, if that file contains a program.
Permissions are granted to three kinds of users:

The ls -l command lists the files and their permissions. Here is a fragment of a listing:

drwxr-xr-x 5 mort admin 4096 Apr 25 12:05 TedMad
-rw-r--r-- 1 mort admin 3526 Feb 28 1996  temp
-rw-r--r-- 1 mort admin 24   Mar 16 18:01 test.html

There is one line per file. In the top line, drwxr-xr-x is the permissions, mort is the owner, and admin is his group; the following entries are the file size in bytes, the date/time of last modification, and the filename.

The first character in the permissions is "d" for a directory, "-" for ordinary files. This is followed by 3 groups of 3, indicating the owner, group, and world permissions. In the top line, mort has rwx (read, write, execute) permission, and his group and the world have r-x (read and execute) only. 

Next: Changing file permissions

Previous: Some basic commands