Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### FILE PERMISSIONS, OWNERS AND GROUPS ###
- "ls -l" example
- drw-r--r-- 2 user wheel 4098 Dec 14 05:21 directory1
- -rwxr-xr-x 1 user wheel 19271 Dec 16 23:04 file2.sh
- (-rwxr-xr-x) (1) (user) (wheel) (19271) (Dec 16 23:04) (file2.sh)
- <permissions> <number of hard links> <owner> <group> <file size> <date> <file name>
- # permissions
- d = directory
- rwx {
- r = read permissions
- w = edit (write) permissions
- x = execute (run) permissions
- }
- 3 groups of rwx
- <owner> <group> <other> # respectively
- -(rwx)(rwx)(rwx)
- #binary and octal
- 001 = 1
- 010 = 2
- 011 = 3
- 100 = 4
- 101 = 5
- 110 = 6
- 111 = 7
- #if 0 = '-'
- chmod <octal number> <file> # change permissions of files
- ex.
- chmod 444 file1
- -r--r--r--
- (4 = 100 = r--)
- # first "-" is directory or other specific type
- chmod 664 file1
- -rw-rw-r--
- # owner and group will be able to read and edit, while everyone else will only be able to read it
- chown <name> <file> # change owner of file
- chgrp <name> <file> # change group of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement