|
12 years ago 1 |
Write the permissions you want the file to have. To make your life easier, write the permissions grouped into sets of three letters. For example, let’s say you want file info.sh
to have these permissions
- rwx r-x r-- info.sh
Under each letter, write a digit 1; under each dash write a digit zero. Ignore the dash at the very beginning that tells you whether it’s a file or directory. This gives you three binary numbers.
- rwx r-x r-- info.sh 111 101 100
Now convert each set of three digits to a single digit using this table:
|
|
From our example, the 111 101 100
translates to the number 754
.
Now use that number in a chmod
command to set your desired permissions on the file:
chmod 754 info.sh
Actually....
You should NOT use the octal number representation as that could cause problems.
The proper way is something like this...
To do this change:
- rwx r-x r-- info.sh -> - rwx rwx r-- info.sh
run this command:
chmod g+w info.sh
This way you are explicitly adding (+) write permission (w) to all in your group (g)
Possible operations; add(+) set to(=) or remove(-)
Usual permissions; write(w) read(r) or execute(x)
Possible groupings; user(u) group(g) other(o) or all(a)( )
Hi
i really really like it!
it is really cool tutorials...thank you :D
شكرا لك