Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Carlos Lantigua5,938 Points
console foundations Quiz Question 2 of 3
Question: Which of the following octal representations is equivalent to the following permission string: -rwxr-x--x
I am not understanding why this is equal to 751, going by what I learned from the video and teachers note, I am thinking it should be 734.
r = 4, w = 2, x =1
|rwx| |rwx| |rwx|
I am terrible at math so maybe I am missing something, please explain if I am, thank you.
Let's break the permissions into sections:
- User: rwx
- Group: r-x
- Other: --x
As you state in your post r = 4, w = 2, x = 1 and a lack of permission is 0.
So to calculate the user number it is 4 + 2 + 1, which equals 7. For the group it is 4 + 0 + 1, which equals 5. For other it is 0 + 0 + 1, which equals 1.
Therefore you end up with 751.