Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools Console Foundations Users and Permissions File Permissions

Carlos Lantigua
Carlos Lantigua
5,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

Answer: 751

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|

+1.......+2.......+3...

I am terrible at math so maybe I am missing something, please explain if I am, thank you.

1 Answer

andren
andren
28,526 Points

Let's break the permissions into sections:

  1. User: rwx
  2. Group: r-x
  3. 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.

Carlos Lantigua
Carlos Lantigua
5,938 Points

Ok I understand it now, its the equivalent of all the numbers in involved in that group. Thank you for the clear explanation.