![]() |
![]() ![]() |
APPENDIX A - Setting File Permissions (Unix) |
There are three types of permissions: USER, GROUP and OTHERS in UNIX files. Each permission consists of three numbers - 4 for read, 2 for write, and 1 for execute access. By adding these numbers, the permissions make up one digit. For example, 4 + 2 + 1 = 7 grants read, write, and execute right while 4 + 1 = 5 grants read and execute right.
The following command makes the file filename readable, writable, and executable by the owner (USER) of the file while making it only readable and executable by the group you are (GROUP) and the world (OTHERS) .
chmod 755 filename
The first digit corresponds to the access right of user, the second digit is that of group, and the final digit is that of others. In the above example, (4 + 2 + 1 = 7)=USER, (4 + 1 = 5) =GROUP, (4 + 1 = 5) = OTHERS.
The following are a quick reference of file permissions :
PERMISSION
COMMAND
U G O
rwx rwx rwx chmod 777 filename
rwx r-x r-x chmod 755 filename
rw- r-- r-- chmod 644 filename
U = User
G = Group
O = Others
r = Read
w = write
x = execute
- = no permission
Note: Please set the file permissions correctly. It is the main reason why the program cannot run.
http://www.eternalmart.com | ![]() ![]() |