File permissions - Bash/Unix/Mac
Format is 421
4 - read
2 - write
1 - execute
The following table shows each permission is assigned a value.
Number Octal Permission Representation Ref 0 No permission --- 1 Execute permission --x 2 Write permission -w- 3 Execute and write permission: 1 (execute) + 2 (write) = 3 -wx 4 Read permission r-- 5 Read and execute permission: 4 (read) + 1 (execute) = 5 r-x 6 Read and write permission: 4 (read) + 2 (write) = 6 rw- 7 All permissions: 4 (read) + 2 (write) + 1 (execute) = 7 rwx
$ chmod 755 filename.txt
$ chmod 622 filename2.txt
$ chmod
Shows how much memory is free
$ watch free -h
No comments:
Post a Comment