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.txt

The 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.sh

Change owner and group

sudo chown student:staff notes.txt

Good 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.

Want every command on one page? Linux & Enterprise Configuration Guide · $9.99View on Gumroad