UNIX files all belong to a specific user and group, and each file can be read, written (edited) or executed
Using the
ls -l
command will produce an output that looks like this
-rw------- 1 jsmith 81405 Nov 3 1995 aporepressor.pdb drwxr-xr-x 2 wang 512 Feb 13 1996 bio227 -rw-r--r-- 1 james 3168 Jun 25 23:14 blast.matrix -rw-r--r-- 1 ldw 4336 Jun 24 14:11 ceu44902.seq -rw-rw-r-- 1 test 19379 Jul 31 11:16 columbia.ps
The first group of characters indicate the type of file and the permissions associated with it.
|
Type |
Owner |
Group |
Everyone |
# |
Owner |
Size |
Date |
Name | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
-,d,l |
r |
w |
x |
r |
w |
x |
r |
w |
x |
|
|
|
|
|
|
- |
r |
w |
x |
r |
- |
x |
r |
- |
- |
1 |
jsmith |
82349 |
Feb 13 1996 |
filename.txt |
The first character indicates whether the item is a file or a directory.
|
What it Says |
What it Means |
- |
It's a file |
d |
It's a directory |
l |
It's a link to a file |
The next three characters are the permissions for the owner of the file, after that come the permissions for everyone in the Owner's group, and then finally, the last 3 characters indicate the permissions for everybody else who has an account on the computer system.
|
What it Says |
What it Means |
r |
It can be read |
w |
It can be changed |
x |
It can be executed |
- |
It can't be |
The chmod command allows you to change the file permissions to allow only specific people to view your files and directories.
For more help with UNIX file permissions, check out the ls or the chmod commands.