Skip to main content

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 d at 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 0777 instead of 777 to 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.

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 d at 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 0777 instead of 777 to 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.

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 d at 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 0777 instead of 777 to 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?

As pointed out by LarsH, this isn't about attributes. I think a better description is file types.
Link
Stephen Kitt
  • 481.1k
  • 59
  • 1.2k
  • 1.4k

Understanding UNIX permissions and their attributesfile types

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 permisson determienpermission 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 aqcuiredacquired 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 cmmandcommand.


But...

I still have a few questions:

  • What does the d at 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 0777 instead of 777 to 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 unixUnix/linuxLinux platform and if this is a stupid question, please excuse me for asking.

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 permisson determien 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 aqcuired 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 cmmand.


But...

I still have a few questions:

  • What does the d at 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 0777 instead of 777 to 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.

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 d at 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 0777 instead of 777 to 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.

Slight improvement to question
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
Rollback to Revision 18
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
added 44 characters in body
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
Post Reopened by Michael Mrozek
edited tags
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
added 9 characters in body
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
added 15 characters in body
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
added 7 characters in body
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
Tried improving my question for future reference
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
edited title
Source Link
Peter
  • 1.1k
  • 2
  • 11
  • 18
Loading
Notice removed Reward existing answer by Peter
Bounty Ended with Stephen Kitt's answer chosen by Peter