In Linux, the number 750 is a shorthand way to represent three sets of permissions: one for the Owner, one for the Group, and one for Others.
Each digit is calculated by adding up the values of the permissions you want to grant:
- 4 = Read (r)
- 2 = Write (w)
- 1 = Execute (x)
- 0 = No permission
Breakdown of 750:
- 7 (Owner - jack): 4+2+1 = 7.
- Jack has read, write, and execute permissions (rwx). He has full control.
- 5 (Group - jack): 4+0+1 = 5.
- Anyone in the
jackgroup has read and execute permissions (r-x). They can see the file and run it, but they cannot change the contents.
- Anyone in the
- 0 (Others): 0+0+0 = 0.
- Everyone else on the system has no permissions (---). They cannot read it, write to it, or run it.
Why use numbers?
It is much faster to type chmod 750 than to type out the symbolic equivalent (chmod u=rwx,g=rx,o=).
Common Examples:
- 777: Everyone can do everything (usually unsafe!).
- 644: Owner can read/write; everyone else can only read (common for text files).
- 700: Only the owner can do anything; total privacy.
When you run ls -l, you will see these numbers converted into letters like this: -rwxr-x---. Notice how they match the groups of three