-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPerm.txt
30 lines (27 loc) · 1.09 KB
/
Perm.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#File Permissions
# Permission rwx Binary
7 read, write and execute rwx 111
6 read and write rw- 110
5 read and execute r-x 101
4 read only r-- 100
3 write and execute -wx 011
2 write only -w- 010
1 execute only --x 001
0 none --- 000
#For a directory, execute means you can enter a directory.
User Group Others Description
6 4 4 User can read and write, everyone else can read (Default file permissions)
7 5 5 User can read, write and execute, everyone else can read and execute (Default directory permissions)
u - User
g - Group
o - Others
a - All of the above
ls -l /foo.sh # List file permissions
chmod +100 foo.sh # Add 1 to the user permission
chmod -100 foo.sh # Subtract 1 from the user permission
chmod u+x foo.sh # Give the user execute permission
chmod g+x foo.sh # Give the group execute permission
chmod u-x,g-x foo.sh # Take away the user and group execute permission
chmod u+x,g+x,o+x foo.sh # Give everybody execute permission
chmod a+x foo.sh # Give everybody execute permission
chmod +x foo.sh # Give everybody execute permission