Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ya, they are binary codes and the layout is rwxrwxrwx where the 1st rwx is user, 2nd rwx is group, and the 3rd is other. Put a one in the spots you want enabled, a 0 where you want disabled. And then convert the result of each group into decimal. For instance 101 (r-x) = 5.
I drew a reference guide to chmod once and I always refer to it:
Code:
OWNER GROUP WORLD
r w x r w x r w x
1 1 1 1 0 1 1 0 1
7 5 5
|______|_______|
|
755
As long as you can count in binary it makes perfect sense.
This way you can set precise: read, write or execute access levels
to files based on: owner, group or world
where or when ever you want.
ok well what he is trying to get across is that you only actually need the following :
1 === execute
2 === write
4 === read
cause he first states that each group has the available permissoins rwx ..
then now he states that if you want the outcome of the results to be for example r-x, which is read access, execute access, but no write access, then to make it a little easier just use 1's and 0's ....
so a - = not enabled
and either a r,w,x in a position means = is enabled
so in our example we have r-x .. so the following is true :
r = enabled (takes a value of 1)
- = write is NOT enabled (takes a value of 0)
x = execute is enabled (takes a value of 1)
so if you put them together you get 101 because the format is rwx .. got it so far
so if we look at the chart given above we see that read = 4 and execute = 1 so if we add 4 + 1 we get the answer of 5 ...
another quick example ...
we'll use the following -> --x
so if we break it down
- = read is not enabled (takes a value of 0)
w = IS enabled (takes a value of 1)
x = IS enabled (takes a value of 1)
so you put it together and you get 011 (keep in mind the format of rwx, and also our chart above), and add them together (0 + 2 + 1 = 3) you get the answer of 3
just noticed that someone else got to it before me in explaining this little journey, but with both posts i think you'll get a better understand of what jtshaw was trying to get across ...
It's a bitmask, all possible combinations are represented by a unique number. You really only need to memorize 1, 2 and 4 (if there were more options would then go to 8, 16, 32, etc...) Just add the numbers together for the combinations. It's not that hard.
starting to make sense guys. Thanks. All I need to do is contiune to reread it till it sticks. I love this place. Everyone is so helpful and no one has an attitude about. Thanks for being so cool
Really should use user, group and other instead of owner, group and world if you don't want to confuse people with things like chmod o+r. A newbie is more likely to think that grants the owner read permission than the world. There's no reason to make it more difficult than it really is IMHO.
DrOzz's method of figuring out the codes is great to learn but at some point everyone should be able to convert the oct and hex digits to binary and the reverse in there heads.
Ok, let me rephrase that, anyone who likes to work with computers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.