File Permissions and Access Control Lists

  • after creating a file and doing ls -ltr, it has -rw-r--r--.

  • after doing chmod +777 test.txt, it has -rwxrwxrwx.

The file permissions are given to a particular user, group or owner, which has read permission where a certain user can read the file or not, write permission where a certain user can write the file or not and execute permission where a certain user can execute the file. Each of the three permissions is assigned to three defined categories of users.

The three commands for file permissions are:-

  1. chmod -used to change the permissions of the file or directory.

  2. chown -used to change the ownership of the file or directory.

  3. chgrp -used to change the permission of a file or directory.