chmod [options] files or dirs
- cp some src dir in some aero361 project and name it something. You will be playing with the contents of this dir so make sure you are playing in the copy of some src that you need for your project.
- type ls -l
drwxr-xr-x 2 viper users 70 Nov 15 17:54 Back/
-rw-r--r-- 1 viper users 5668 Jan 24 09:00 basis.f95
-rw-r--r-- 1 viper users 6920 Jan 24 09:00 basis.g90
-rw-r--r-- 1 viper users 16892 Jan 24 09:00 basis.o
-rw-r--r-- 1 viper users 4030 Jan 20 10:12 spline.f95
-rw-r--r-- 1 viper users 6244 Jan 22 21:28 spline.g90
-rw-r--r-- 1 viper users 14032 Jan 22 21:28 spline.o
- in the above example
- 1st column contains the permissions a "d" preceeding the permissions means dir
- 2nd column contains the address
- 3rd column contains the owners name
- Concentrate your attention on the 1st column
- --- --- ---
- user group other
LETTER
PERMISSION
OCTAL VALUE
---
No permissions
0
r--
Read only
4
rw-
read and write permissions
6
rwx
read,write and execute permissions
7
r-x
read and execute permissions
5
--x
execute permissions only
1
PERMISSIONS
NUMBER FORM
SYMBOLIC FORM
WHAT JUST HAPPENED
-rw-------
600
u=rw
Owner has read and write permissions. Set for most files
-rw-r--r--
644
u=rw,g=r,o=r
Owner has read and write permissions; group has read permisions and other have read permissions
-rw-rw-rw-
666
a=rw
all have read write permissions
-rwx------
700
u=rwx
only owner has read, write and execute permissions
-rwxr-xr-x
755
u=rwx,go=rx
Owner has read,write and execute; group has read and execute; other has read and execute
-rwxrwxrwx
777
a=rwx
all have read write permissions
-rwx-x--x
711
u=rwx,go=x
Owner read, write and execute permisions; group and other have exucute permissions
- How to change the permissions
- chmod 777 file1
- this will give all rwx permissions
- chmod 700 file1
- rwx only to lyou
- chmod og +x file1
- add execute permissions to group and other
- chmod og -x file1
- takes the execute permissions away from group and other