This guide is for learning. Run these commands only on your own lab or servers.
Every file has an owner, a group and permissions for three kinds of users. Reading the output of ls -l is the first skill to learn.
ls -l notes.txt
-rw-r----- 1 student staff 120 notes.txtThe first block is the owner (rw-), then the group (r--), then everyone else (---). Read is 4, write is 2 and execute is 1.
Change permissions
chmod 640 notes.txt
chmod u+x script.shChange owner and group
sudo chown student:staff notes.txtGood habits
Give the least access that works. Avoid chmod 777, because it lets every user on the system change the file.
Practise on test files in your home folder, not on system directories.



