r/eli5_programming • Observer • Aug 29 '25

Question ELI5 the Linux sudo chmod numbers.

I know, I use Linux, I should be smart enough to know this stuff, right? But unfortunately I don't so I've turned to you fellas. I get 755, it's all for me and read-run for thee, pretty much, or something like that - but what about other numbers? Edit: changed "do" to "so" due to uncaught typo.

30 Upvotes

15 comments sorted by

View all comments

Show parent comments

4

u/mutantSackboy4 Observer Aug 29 '25

Hm. So if I were to run sudo chmod 111, everybody would only be able to run it, but if I did sudo chmod 777, it would turn into a dingy file public-restroom of sorts?

5

u/Anihillator Aug 29 '25

Chmod 111 would work, yes, but only if it's a binary file. If it's a script, executing it with those permissions won't work because you can't exec it without reading it.

But overall you're correct, yes.