In Linux, file permissions are set using the chmod
command. File permissions are represented by three categories: owner, group, and others, and are denoted by read (r), write (w), and execute (x).
To change permissions, use:
bash
chmod [permissions] filename
For example, to give the owner read and write permissions, and others read permissions:
bash
chmod 644 filename
You can also use symbolic representation, like:
bash
chmod u+x filename # Add execute permission to the user (owner)
chmod g-w filename # Remove write permission from the group
Use ls -l
to view file permissions.