I've never really got how chmod worked up until today. I followed a tutorial that explained a big deal to me.
For example, I've read that you've got three different permission groups:
- owner (
(u)) - group (
(g)) - everyone (
(o))
Based on these three groups, I now know that:
- If the file is owned by the user, the user permissions determine the access.
- If the group of the file is the same as the user's group, the group permission determine the access.
- If the user is not the file owner, and is not in the group, then the other permission is used.
I've also learned that you've got the following permissions:
- read (
(r)) - write (
(w)) - execute (
(x))
I created a directory to test my newly acquired knowledge:
mkdir test
Then I did some tests:
chmod u+rwx test/
# drwx------
chmod g+rx test/
# drwxr-x---
chmod u-x test/
# drw-r-x---
After fooling around for some time I think I finally got the hang of chmod and the way you set permission using this command.
But...
I still have a few questions:
- What does the
dat the start stand for? - What's the name and use of the containing slot and what other values can it hold?
- How can I set and unset it?
- What is the value for this
d? (As you only have 7=4+2+1 7=4+2+1 7=4+2+1) - Why do people sometimes use
0777instead of777to set their permissions?
But as I shouldn't be asking multiple questions, I'll try to ask it in one question.
In UNIX based system such as all Linux distributions, concerning the permissions, what does the first part ((d)) stand for and what's the use for this part of the permissions?
I would like to add that I am new to the whole Unix/Linux platform and if this is a stupid question, please excuse me for asking.