Man page for file permission numbers












2














Is there a man page for the file permission numbers?



I'm specifically talking about



r = 4
w = 2
x = 1


I can never remember them and I have to google it every time I need to set permissions besides 755. I don't think I'm alone, either, since there's even a site that calculates the number for you.



I just realized the man page for chmod doesn't have any description of the numbers and I can't figure out what other page would have them. I guess an info page would work as well, since apparently it comes pre-installed (I have arch; I'd have thought I'd have had to install that one myself--apparently not). It would be a lot easier for me if I could just refer to an 'on-line' man page (I use 'on-line' in the sense used in man man).










share|improve this question


















  • 1




    I am having trouble finding a man page that doesn't list the mode bits in it. The GNU man page it sounds like you'd have certainly does: "The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)". Are you sure it's not there?
    – Michael Homer
    6 hours ago












  • @MichaelHomer Yeah, I should have read more carefully. I was looking for a table. Terrible laziness on my part all day today.
    – malan
    6 hours ago








  • 2




    I remember it in terms of postion, rwx, and convert from binary. So "r" is 100, "w" is 010, "x" is 001. In binary that means r=4, w=2, x=1. When you see enough ls -l output that "rwx" order eventually gets stuck in your mind :-)
    – Stephen Harris
    6 hours ago










  • @StephenHarris I very much expected this: someone to answer the question and then give me a helpful mnemonic so that I don't even need to look it up anymore. Thanks!
    – malan
    6 hours ago










  • Which operating system?
    – ctrl-alt-delor
    5 hours ago
















2














Is there a man page for the file permission numbers?



I'm specifically talking about



r = 4
w = 2
x = 1


I can never remember them and I have to google it every time I need to set permissions besides 755. I don't think I'm alone, either, since there's even a site that calculates the number for you.



I just realized the man page for chmod doesn't have any description of the numbers and I can't figure out what other page would have them. I guess an info page would work as well, since apparently it comes pre-installed (I have arch; I'd have thought I'd have had to install that one myself--apparently not). It would be a lot easier for me if I could just refer to an 'on-line' man page (I use 'on-line' in the sense used in man man).










share|improve this question


















  • 1




    I am having trouble finding a man page that doesn't list the mode bits in it. The GNU man page it sounds like you'd have certainly does: "The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)". Are you sure it's not there?
    – Michael Homer
    6 hours ago












  • @MichaelHomer Yeah, I should have read more carefully. I was looking for a table. Terrible laziness on my part all day today.
    – malan
    6 hours ago








  • 2




    I remember it in terms of postion, rwx, and convert from binary. So "r" is 100, "w" is 010, "x" is 001. In binary that means r=4, w=2, x=1. When you see enough ls -l output that "rwx" order eventually gets stuck in your mind :-)
    – Stephen Harris
    6 hours ago










  • @StephenHarris I very much expected this: someone to answer the question and then give me a helpful mnemonic so that I don't even need to look it up anymore. Thanks!
    – malan
    6 hours ago










  • Which operating system?
    – ctrl-alt-delor
    5 hours ago














2












2








2







Is there a man page for the file permission numbers?



I'm specifically talking about



r = 4
w = 2
x = 1


I can never remember them and I have to google it every time I need to set permissions besides 755. I don't think I'm alone, either, since there's even a site that calculates the number for you.



I just realized the man page for chmod doesn't have any description of the numbers and I can't figure out what other page would have them. I guess an info page would work as well, since apparently it comes pre-installed (I have arch; I'd have thought I'd have had to install that one myself--apparently not). It would be a lot easier for me if I could just refer to an 'on-line' man page (I use 'on-line' in the sense used in man man).










share|improve this question













Is there a man page for the file permission numbers?



I'm specifically talking about



r = 4
w = 2
x = 1


I can never remember them and I have to google it every time I need to set permissions besides 755. I don't think I'm alone, either, since there's even a site that calculates the number for you.



I just realized the man page for chmod doesn't have any description of the numbers and I can't figure out what other page would have them. I guess an info page would work as well, since apparently it comes pre-installed (I have arch; I'd have thought I'd have had to install that one myself--apparently not). It would be a lot easier for me if I could just refer to an 'on-line' man page (I use 'on-line' in the sense used in man man).







permissions man chmod






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 6 hours ago









malan

592418




592418








  • 1




    I am having trouble finding a man page that doesn't list the mode bits in it. The GNU man page it sounds like you'd have certainly does: "The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)". Are you sure it's not there?
    – Michael Homer
    6 hours ago












  • @MichaelHomer Yeah, I should have read more carefully. I was looking for a table. Terrible laziness on my part all day today.
    – malan
    6 hours ago








  • 2




    I remember it in terms of postion, rwx, and convert from binary. So "r" is 100, "w" is 010, "x" is 001. In binary that means r=4, w=2, x=1. When you see enough ls -l output that "rwx" order eventually gets stuck in your mind :-)
    – Stephen Harris
    6 hours ago










  • @StephenHarris I very much expected this: someone to answer the question and then give me a helpful mnemonic so that I don't even need to look it up anymore. Thanks!
    – malan
    6 hours ago










  • Which operating system?
    – ctrl-alt-delor
    5 hours ago














  • 1




    I am having trouble finding a man page that doesn't list the mode bits in it. The GNU man page it sounds like you'd have certainly does: "The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)". Are you sure it's not there?
    – Michael Homer
    6 hours ago












  • @MichaelHomer Yeah, I should have read more carefully. I was looking for a table. Terrible laziness on my part all day today.
    – malan
    6 hours ago








  • 2




    I remember it in terms of postion, rwx, and convert from binary. So "r" is 100, "w" is 010, "x" is 001. In binary that means r=4, w=2, x=1. When you see enough ls -l output that "rwx" order eventually gets stuck in your mind :-)
    – Stephen Harris
    6 hours ago










  • @StephenHarris I very much expected this: someone to answer the question and then give me a helpful mnemonic so that I don't even need to look it up anymore. Thanks!
    – malan
    6 hours ago










  • Which operating system?
    – ctrl-alt-delor
    5 hours ago








1




1




I am having trouble finding a man page that doesn't list the mode bits in it. The GNU man page it sounds like you'd have certainly does: "The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)". Are you sure it's not there?
– Michael Homer
6 hours ago






I am having trouble finding a man page that doesn't list the mode bits in it. The GNU man page it sounds like you'd have certainly does: "The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)". Are you sure it's not there?
– Michael Homer
6 hours ago














@MichaelHomer Yeah, I should have read more carefully. I was looking for a table. Terrible laziness on my part all day today.
– malan
6 hours ago






@MichaelHomer Yeah, I should have read more carefully. I was looking for a table. Terrible laziness on my part all day today.
– malan
6 hours ago






2




2




I remember it in terms of postion, rwx, and convert from binary. So "r" is 100, "w" is 010, "x" is 001. In binary that means r=4, w=2, x=1. When you see enough ls -l output that "rwx" order eventually gets stuck in your mind :-)
– Stephen Harris
6 hours ago




I remember it in terms of postion, rwx, and convert from binary. So "r" is 100, "w" is 010, "x" is 001. In binary that means r=4, w=2, x=1. When you see enough ls -l output that "rwx" order eventually gets stuck in your mind :-)
– Stephen Harris
6 hours ago












@StephenHarris I very much expected this: someone to answer the question and then give me a helpful mnemonic so that I don't even need to look it up anymore. Thanks!
– malan
6 hours ago




@StephenHarris I very much expected this: someone to answer the question and then give me a helpful mnemonic so that I don't even need to look it up anymore. Thanks!
– malan
6 hours ago












Which operating system?
– ctrl-alt-delor
5 hours ago




Which operating system?
– ctrl-alt-delor
5 hours ago










2 Answers
2






active

oldest

votes


















5














man chmod is likely to give you the command line tool. This may include some text that is easy to miss




The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)




If you do man 2 chmod then you get the system call that actually does the work. This is harder to read, but does include the magic numbers:



   S_IRUSR  (00400)  read by owner
S_IWUSR (00200) write by owner
S_IXUSR (00100) execute/search by owner ("search" applies for direc-
tories, and means that entries within the directory
can be accessed)
S_IRGRP (00040) read by group
S_IWGRP (00020) write by group
S_IXGRP (00010) execute/search by group
S_IROTH (00004) read by others
S_IWOTH (00002) write by others
S_IXOTH (00001) execute/search by others


It also provides some other magic values:



   S_ISUID  (04000)  set-user-ID  (set  process  effective  user   ID   on
execve(2))

S_ISGID (02000) set-group-ID (set process effective group ID on
execve(2); mandatory locking, as described in
fcntl(2); take a new file's group from parent direc-
tory, as described in chown(2) and mkdir(2))

S_ISVTX (01000) sticky bit (restricted deletion flag, as described in
unlink(2))





share|improve this answer























  • Any idea what the S_I prefix stands for?
    – undercat
    6 hours ago






  • 4




    @undercat I always guessed it was "stat" "inode"... but that's just a guess and probably totally wrong :-)
    – Stephen Harris
    6 hours ago



















1














If you have Gnu chmod, then you can do it symbolically, e.g. chmod u+rw,g+r «file-name»



Gnu chmod is available on most Gnu/Linux systems, and can be installed on other systems.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491829%2fman-page-for-file-permission-numbers%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5














    man chmod is likely to give you the command line tool. This may include some text that is easy to miss




    The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)




    If you do man 2 chmod then you get the system call that actually does the work. This is harder to read, but does include the magic numbers:



       S_IRUSR  (00400)  read by owner
    S_IWUSR (00200) write by owner
    S_IXUSR (00100) execute/search by owner ("search" applies for direc-
    tories, and means that entries within the directory
    can be accessed)
    S_IRGRP (00040) read by group
    S_IWGRP (00020) write by group
    S_IXGRP (00010) execute/search by group
    S_IROTH (00004) read by others
    S_IWOTH (00002) write by others
    S_IXOTH (00001) execute/search by others


    It also provides some other magic values:



       S_ISUID  (04000)  set-user-ID  (set  process  effective  user   ID   on
    execve(2))

    S_ISGID (02000) set-group-ID (set process effective group ID on
    execve(2); mandatory locking, as described in
    fcntl(2); take a new file's group from parent direc-
    tory, as described in chown(2) and mkdir(2))

    S_ISVTX (01000) sticky bit (restricted deletion flag, as described in
    unlink(2))





    share|improve this answer























    • Any idea what the S_I prefix stands for?
      – undercat
      6 hours ago






    • 4




      @undercat I always guessed it was "stat" "inode"... but that's just a guess and probably totally wrong :-)
      – Stephen Harris
      6 hours ago
















    5














    man chmod is likely to give you the command line tool. This may include some text that is easy to miss




    The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)




    If you do man 2 chmod then you get the system call that actually does the work. This is harder to read, but does include the magic numbers:



       S_IRUSR  (00400)  read by owner
    S_IWUSR (00200) write by owner
    S_IXUSR (00100) execute/search by owner ("search" applies for direc-
    tories, and means that entries within the directory
    can be accessed)
    S_IRGRP (00040) read by group
    S_IWGRP (00020) write by group
    S_IXGRP (00010) execute/search by group
    S_IROTH (00004) read by others
    S_IWOTH (00002) write by others
    S_IXOTH (00001) execute/search by others


    It also provides some other magic values:



       S_ISUID  (04000)  set-user-ID  (set  process  effective  user   ID   on
    execve(2))

    S_ISGID (02000) set-group-ID (set process effective group ID on
    execve(2); mandatory locking, as described in
    fcntl(2); take a new file's group from parent direc-
    tory, as described in chown(2) and mkdir(2))

    S_ISVTX (01000) sticky bit (restricted deletion flag, as described in
    unlink(2))





    share|improve this answer























    • Any idea what the S_I prefix stands for?
      – undercat
      6 hours ago






    • 4




      @undercat I always guessed it was "stat" "inode"... but that's just a guess and probably totally wrong :-)
      – Stephen Harris
      6 hours ago














    5












    5








    5






    man chmod is likely to give you the command line tool. This may include some text that is easy to miss




    The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)




    If you do man 2 chmod then you get the system call that actually does the work. This is harder to read, but does include the magic numbers:



       S_IRUSR  (00400)  read by owner
    S_IWUSR (00200) write by owner
    S_IXUSR (00100) execute/search by owner ("search" applies for direc-
    tories, and means that entries within the directory
    can be accessed)
    S_IRGRP (00040) read by group
    S_IWGRP (00020) write by group
    S_IXGRP (00010) execute/search by group
    S_IROTH (00004) read by others
    S_IWOTH (00002) write by others
    S_IXOTH (00001) execute/search by others


    It also provides some other magic values:



       S_ISUID  (04000)  set-user-ID  (set  process  effective  user   ID   on
    execve(2))

    S_ISGID (02000) set-group-ID (set process effective group ID on
    execve(2); mandatory locking, as described in
    fcntl(2); take a new file's group from parent direc-
    tory, as described in chown(2) and mkdir(2))

    S_ISVTX (01000) sticky bit (restricted deletion flag, as described in
    unlink(2))





    share|improve this answer














    man chmod is likely to give you the command line tool. This may include some text that is easy to miss




    The second digit selects permissions for the user who owns the file: read (4), write (2), and execute (1)




    If you do man 2 chmod then you get the system call that actually does the work. This is harder to read, but does include the magic numbers:



       S_IRUSR  (00400)  read by owner
    S_IWUSR (00200) write by owner
    S_IXUSR (00100) execute/search by owner ("search" applies for direc-
    tories, and means that entries within the directory
    can be accessed)
    S_IRGRP (00040) read by group
    S_IWGRP (00020) write by group
    S_IXGRP (00010) execute/search by group
    S_IROTH (00004) read by others
    S_IWOTH (00002) write by others
    S_IXOTH (00001) execute/search by others


    It also provides some other magic values:



       S_ISUID  (04000)  set-user-ID  (set  process  effective  user   ID   on
    execve(2))

    S_ISGID (02000) set-group-ID (set process effective group ID on
    execve(2); mandatory locking, as described in
    fcntl(2); take a new file's group from parent direc-
    tory, as described in chown(2) and mkdir(2))

    S_ISVTX (01000) sticky bit (restricted deletion flag, as described in
    unlink(2))






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 6 hours ago

























    answered 6 hours ago









    Stephen Harris

    25k24477




    25k24477












    • Any idea what the S_I prefix stands for?
      – undercat
      6 hours ago






    • 4




      @undercat I always guessed it was "stat" "inode"... but that's just a guess and probably totally wrong :-)
      – Stephen Harris
      6 hours ago


















    • Any idea what the S_I prefix stands for?
      – undercat
      6 hours ago






    • 4




      @undercat I always guessed it was "stat" "inode"... but that's just a guess and probably totally wrong :-)
      – Stephen Harris
      6 hours ago
















    Any idea what the S_I prefix stands for?
    – undercat
    6 hours ago




    Any idea what the S_I prefix stands for?
    – undercat
    6 hours ago




    4




    4




    @undercat I always guessed it was "stat" "inode"... but that's just a guess and probably totally wrong :-)
    – Stephen Harris
    6 hours ago




    @undercat I always guessed it was "stat" "inode"... but that's just a guess and probably totally wrong :-)
    – Stephen Harris
    6 hours ago













    1














    If you have Gnu chmod, then you can do it symbolically, e.g. chmod u+rw,g+r «file-name»



    Gnu chmod is available on most Gnu/Linux systems, and can be installed on other systems.






    share|improve this answer


























      1














      If you have Gnu chmod, then you can do it symbolically, e.g. chmod u+rw,g+r «file-name»



      Gnu chmod is available on most Gnu/Linux systems, and can be installed on other systems.






      share|improve this answer
























        1












        1








        1






        If you have Gnu chmod, then you can do it symbolically, e.g. chmod u+rw,g+r «file-name»



        Gnu chmod is available on most Gnu/Linux systems, and can be installed on other systems.






        share|improve this answer












        If you have Gnu chmod, then you can do it symbolically, e.g. chmod u+rw,g+r «file-name»



        Gnu chmod is available on most Gnu/Linux systems, and can be installed on other systems.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 5 hours ago









        ctrl-alt-delor

        10.8k41957




        10.8k41957






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491829%2fman-page-for-file-permission-numbers%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Eastern Orthodox Church

            Zagreb

            Understanding the information contained in the Deep Space Network XML data?