Results 1 to 7 of 7

Thread: What's the first of the five' file permission numerical mode digits?

  1. #1
    Join Date
    Jul 2013
    Beans
    13

    What's the first of the five' file permission numerical mode digits?

    By doing for example in a file
    Code:
    chmod 00755 file
    What does the first zero indicates?
    Thanks.

  2. #2
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

  3. #3
    Join Date
    Jul 2013
    Beans
    13

    Re: What's the first of the five' file permission numerical mode digits?

    Sorry, I can't find that information in the link.

  4. #4
    Join Date
    Sep 2006
    Beans
    7,953
    Distro
    Lubuntu Development Release

    four digits only

    If there are 5 digits instead of 4, it is probably a typo. With 4 digits, the first one has to do with set GID, set UID, and sticky bit for file permissions. You can see them in detail for any given file using stat.

    Code:
    stat /etc/apt/sources.list
    The Truth Shall Make Ye Fret.

  5. #5
    Join Date
    Jul 2013
    Beans
    13

    Re: four digits only

    Quote Originally Posted by Lars Noodén View Post
    If there are 5 digits instead of 4, it is probably a typo. With 4 digits, the first one has to do with set GID, set UID, and sticky bit for file permissions. You can see them in detail for any given file using stat.

    Code:
    stat /etc/apt/sources.list
    I think it's not a typo because I found it in many books.

  6. #6
    Join Date
    Apr 2012
    Beans
    5,900

    Re: What's the first of the five' file permission numerical mode digits?

    AFAIK the chmod program can only access the lower 4 octal digits (i.e. up to the setuid / setgid / sticky bit) however the higher bits in the mask are used by the internal stat structure to indicate things like whether it is a regular file / block device / FIFO / link and so on. In particular 40000 is the directory mask - see

    Code:
    man 2 stat
    for details

  7. #7
    Join Date
    Jul 2013
    Beans
    13

    Re: What's the first of the five' file permission numerical mode digits?

    Quote Originally Posted by steeldriver View Post
    AFAIK the chmod program can only access the lower 4 octal digits (i.e. up to the setuid / setgid / sticky bit) however the higher bits in the mask are used by the internal stat structure to indicate things like whether it is a regular file / block device / FIFO / link and so on. In particular 40000 is the directory mask - see

    Code:
    man 2 stat
    for details
    Thanks.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •