Tutorial by Examples

> chmod 644 example.txt > ls -l example.txt -rw-r--r-- 1 owner ogroup 57 Jul 3 10:13 example.txt The above command changes the file permissions to allow the file owner to read and write to a file. It also allows users in the owner's group and other users in the system to read the file....
Let's say there is a file we would like to execute, a bash script named add.sh, for example. Typing ./add.sh however, yields a permission error. Getting the permissions is a simple process. To determine the permissions a file has, type: ls -l filename, or, in our case, ls -l ./add.sh This prints ...
CHMOD Calculation CHMOD is binary. _ / _ _ _ / _ _ _ / _ _ _ = _/4+2+1/4+2+1/4+2+1 = 777 = _/rwx/rwx/rwx = 777 Therefore _rwx = _/4+2+1 = 7 D / _ _ _ / _ _ _ / _ _ _ (‘D’ = directory, another use is L = Link) So e.g. _rwxr_xr_x = _/rwx/rx/r_x = 755
To change own:group you use command chown user:group e.g. chown owner:group or if owner and group are same you can use chown owner: (because linus assumes owner:group are same).

Page 1 of 1