![]() |
![]() |
![]() |
![]() |
Before you get yourself into trouble by changing file permissions, you need to know what they are and what they do. You start by looking at a long listing (ll) in your home directory:
> cd ~
> ls -l
> ll
The result of either of these "long lists" should be something like:
-rw-r--r-- 1 melanie users 3197 May 17 14:29 Mwm -rw-r--r-- 1 melanie users 12983 May 17 14:29 README.first -rwxr-xr-x 1 melanie users 28784 May 17 14:29 a.out* drwxr-xr-x 4 melanie users 512 May 17 14:31 development/ -rw-r--r-- 1 melanie users 1840 May 17 14:29 eqns2.ms -rw-r--r-- 1 melanie users 3923 Jul 28 10:18 plotoutfile.ps drwxr-xr-x 3 melanie users 512 Aug 4 16:03 public-html/ -rw-r--r-- 1 melanie users 19917 May 17 14:29 s2 -rw-r--r-- 1 melanie users 133 Sep 1 18:02 sample.docHere the first column contains 10 characters (d's, r's, w's, x's, and "-"'s) which are code to indicate the file mode. The first character in the code indicates the file type. A "-" indicates an ordinary file and a "d" a directory.
The next nine characters (r's, w's, x's and "-"'s) are actually three sets of three characters each. An "r" indicates read permission, a "w" write (change or delete) permission, and an "x" execute permission. A "-" indicates the absence of a character, and so would mean you cannot read, write, or execute that file.
The first set of characters gives the permissions of the "owner", the second set gives the permissions of the "group", and the third set gives the permissions of "all others".
For the listing we give, melanie is the owner as is indicated in the third column. (You should be the owner in the listing the computer gives you.) It can happen (or be arranged) that you may own files yet be unable to read, write, or execute them. As owner, you can set the permissions anyway you want.
For directories, a "w" gives permission to create files in that directory, and an "x" gives permission to enter that directory.
For example,
-rw-rw-r--
gives you and members of your group read and write permission, and everyone else read permission only. Consider next,
-rwxr-x--x
This gives you permission to read, write, and execute the file. Members of your group have permission to read and execute the file. And all other have permission to only execute it.
Now that you know how to get and understand file permissions, you can modify them.
![]() |
![]() |
![]() |
![]() |