Linux Permission Table with chmod

Linux Permission Table with chmod

Last Blog Review

In the last, blog we learned about the “drwxrwxrwx” permission explains what are the controls on the particular file or directory and the changes that can be done by the user’s or groups. As permission’s have all the control on the read, write and execute on the file and the directory in the Linux.

Understanding the Linux Permission’s table →

  • The above table represents how the read, write, execute permission’s are used in numeric form as a combination for changing the permissions.

  • When we use

    1. ‘0’ it means no permissions are given to user, group, or other user’s

    2. ‘1’ it means only execute permissions are given to user, group, or other user’s

    3. ‘2’ it means only write permissions are given to user, group, or other user’s

    4. ‘3’ it means only write and execute permissions are given to user, group, or other user’s

    5. ‘4’ it means only read permissions are given to user, group, or other user’s

    6. ‘5’ it means only read and execute permissions are given to user, group, or other user’s

    7. ‘6’ it means only read and write permissions are given to user, group, or other user’s

    8. ‘7’ it means read, write, execute permissions are given to user, group, or other user’s

chmod →

  • It represents change mode, which mean it help’s to change the permissions for a file or directory which can be accessed via. user’s or group’s or other user’s.

chown →

  • It represents change ownership, which mean it help’s to change the ownership of the files or directories.

Example’s to understand permission using chmod →

  • If you want to give read (4), write (2), and execute (1) permissions to both the user and group, and only read (4) permission to others, you can use

      chmod 774 <file-name>
    
  • If you want to restrict write permissions to all others except the file’s owner, you can use

      chmod 744 <file-name>
    
  • Give only read permission to the user and no permission’s to the group’s and other user’s

      chmod 400 <file-name>
    

    Conclusion →

    So, we have learned about the Linux permission table, on how to use the numeric value to simply give read, write, and execute permission to the user, group’s and other user’s using a single command with chmod i.e. change mode use.

    💡
    Loved this post? Share it with your friends! If you have any questions or thoughts, leave a comment below – I’m looking forward to hearing your perspective. Don’t forget to subscribe for more content delivered directly to you. Stay tuned for more tips, ideas, and inspiration coming soon!