chmod using Numbers
Ever wondered what the numbers after the chmod command actually mean?
There are always three numbers (in this case 7, 6, and 0).
- The first number designates the permissions for the owner of the file/directory.
- Second is the owning group.
- Third is everyone else.
Each number is really three bits, rwx. Just read permissions is the bits 100 (4), just write is 010 (2), just execute 001 (1). If you want to give execute and read you add execute and read together and you get 5. If you want to give both read and write it would be 6, and so on.
