5 ms·
One octal digit comprises three bits: read, write and execute, with values 4, 2, and 1. Add them and you get the octal digit: 7 is everything permitted, 4 is re
by tgv 5y ago
One octal digit comprises three bits: read, write and execute, with values 4, 2, and 1. Add them and you get the octal digit: 7 is everything permitted, 4 is read-only. The three octal digits represent permission for owner, group and the rest. So stay way from 777.
- Aloha 5y agoI set permissions on something just infrequently enough that I dont have that as muscle memory, and often I need to match permissions on something already there, so I'm trying to go "uhhh, its, rwxr-xr-x what does that translate to again?" Also, frankly, the computer is a calculator, why not have it act as the calculator for me, and tell me what the permissions already are, I can read the octal permissions and know what they mean.
- poewrljaf 5y agochmod --reference=file_with_permissions_i_want.txt file_whose_permissions_i_want_To_change.txt
- Aloha 5y agoyou learn something new every day!
- BenjiWiebe 5y agoYou can also just type --ref.
- mixmastamyk 5y agoThat’s what GUIs are for, this exact use case. The sibling with the reference param is a great option as well, if you can remember it.
- deleted 5y ago[deleted]
- BenjiWiebe 5y agoMy chmod usage generally looks like this: chmod a-rwx,u+rw,g+r,o+r filename a/u/g/o is all, user, group, other. - removes, + adds. r/w/x is read, write, execute (of course).
- randomswede 5y agoThey're bits, in groups of three. rwxr-xrwx would be "111, 101, 111", so 7, 5, 7. I may be odd, but I don't find reading "small numbers" in binary to be much harder than reading "small numbers" in decimal, or hex. Up to about 15-or-so... Maybe as far as 31. But get to six bits, and it's time to actually start doing multiplications and additions, for me.
- I_complete_me 5y agoI use the idea of the binary numbers from 1 to 7 as an aide memoire: rwx 0 000 1 001 2 010 3 011 --> -wx 4 100 5 101 6 110 7 111
- hprotagonist 5y agoonce — exactly once — i heard from down the hall in the dorm “oh fuck this, file permissions are bullshit it’s a single user machine! i’m going to chmod -R 777 / and be done with it” (clicking and the whack of an enter key) (time passes) “oh what th… oh, fuck ME!”