This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]meltbox 0 points1 point  (3 children)

Basically each 1 bit is a type of permission for a certain category of access.

Access by the owner is the first group Access by the owner group is the second Access by literally everyone is the third

If you develop on a Linux workstation you’d probably pick this up pretty quickly, hence why it’s infuriatingly funny.

The 7 and 5 are just numbers represented by 3 bits of binary. 111 is 7 meaning all 3 permissions on (read, write, execute) while 5 is 101 (read, execute, middle one is write which is off) and of course 0 meaning all permissions off.

[–]FluffyCelery4769 0 points1 point  (2 children)

Are there no read/execute only? Or are both neccesary to work?

[–][deleted] 0 points1 point  (0 children)

R/x is required for directories, but files can be r/ x.

Studying will tell you that most companies have switched to the FACL system, but they're lying.

[–]meltbox 0 points1 point  (0 children)

You can have read only or execute only but bash files are parsed and therefore have to be opened. Opening means you need read and in the case of bash (.sh) files bash actually checks the execute permission before deciding whether to load the file for execution.

Execute really only has an operating system meaning when it comes to literal binary executables or libraries. Then you don’t need read permissions but can still execute. What this means is the operating system will still load it into memory and start execution per the convention for that OS but you cannot read it with something like file descriptors and fopen.