How To Change Permissions From Letters To Numbers

RegisterLogin
How To Change Permissions From Letters To Numbers
Post Description: do you want to know how to change permissions from letters to numbers to use in chmod command in linux - if so, i will show you in this short simple tutorials
Tags: how, to, change, permissions, from, letters, to, numbers
This Post Was Posted On Mar 31, 2010 By Webune Support #3317
do you want to know how to change permissions from letters to numbers - if so, i will show you in this short simple tutorials.

its very easy, for example, lets say you want to give a file permission like this:

-rwxr-----

looking at those permissions, how to you convert it from octal to digits, the numerical permissions would be 740

how did i come up with 740?

like this

first you divide the octal value into three separate segments which contain three values

in our example we have 10 values, lets break it down

#1. -
#2. r
#3. w
#4. x
#5. r
#6. -
#7. -
#8. -
#9. -
#10. -

ok, we ignore #1

so lets separate the nine remaining spaces into three segments

#2. r
#3. w
#4. x

#5. r
#6. -
#7. -

#8. -
#9. -
#10. -

the way to figure out what rwx means, we need to take a look at each letter.

the first is equals to 4
the second is equals to 2
and the third is equals to 1

so we end up with this
r = 4
w = 2
x = 1

we add them all up and we come up to 7 - OK!!!! we got the first value, next, lets move to the next three

#5. r
#6. -
#7. -

r = 4
- = 0
- = 0

we add the three values and it equals to 4

now the last three

#8. -
#9. -
#10. -

- = 0
- = 0
- = 0

so the third number is equals to 0

we add all three values and we come up with 740

so 740 =
so the next number is 4 rwxr-----

hope that helps

Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2012 Webune Forums - Thu Dec 13, 2012 3:07 am
Powered by: Webune Forums V3