Man page for file permission numbers

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















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

















  • 3





    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
    Dec 31 '18 at 22:10












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

    – malan
    Dec 31 '18 at 22:14







  • 5





    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
    Dec 31 '18 at 22:19











  • @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
    Dec 31 '18 at 22:22






  • 1





    Why on Earth do people use numbers to set file permissions? "chmod [ugo][+-][rwx] works perfectly well for most cases (and there are options for less common ones - read the man page), and is almost impossible to forget.

    – jamesqf
    Jan 1 at 4:20















1















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

















  • 3





    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
    Dec 31 '18 at 22:10












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

    – malan
    Dec 31 '18 at 22:14







  • 5





    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
    Dec 31 '18 at 22:19











  • @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
    Dec 31 '18 at 22:22






  • 1





    Why on Earth do people use numbers to set file permissions? "chmod [ugo][+-][rwx] works perfectly well for most cases (and there are options for less common ones - read the man page), and is almost impossible to forget.

    – jamesqf
    Jan 1 at 4:20













1












1








1








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 Dec 31 '18 at 22:04









malanmalan

619421




619421







  • 3





    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
    Dec 31 '18 at 22:10












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

    – malan
    Dec 31 '18 at 22:14







  • 5





    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
    Dec 31 '18 at 22:19











  • @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
    Dec 31 '18 at 22:22






  • 1





    Why on Earth do people use numbers to set file permissions? "chmod [ugo][+-][rwx] works perfectly well for most cases (and there are options for less common ones - read the man page), and is almost impossible to forget.

    – jamesqf
    Jan 1 at 4:20












  • 3





    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
    Dec 31 '18 at 22:10












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

    – malan
    Dec 31 '18 at 22:14







  • 5





    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
    Dec 31 '18 at 22:19











  • @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
    Dec 31 '18 at 22:22






  • 1





    Why on Earth do people use numbers to set file permissions? "chmod [ugo][+-][rwx] works perfectly well for most cases (and there are options for less common ones - read the man page), and is almost impossible to forget.

    – jamesqf
    Jan 1 at 4:20







3




3





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
Dec 31 '18 at 22:10






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
Dec 31 '18 at 22:10














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

– malan
Dec 31 '18 at 22:14






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

– malan
Dec 31 '18 at 22:14





5




5





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
Dec 31 '18 at 22:19





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
Dec 31 '18 at 22:19













@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
Dec 31 '18 at 22:22





@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
Dec 31 '18 at 22:22




1




1





Why on Earth do people use numbers to set file permissions? "chmod [ugo][+-][rwx] works perfectly well for most cases (and there are options for less common ones - read the man page), and is almost impossible to forget.

– jamesqf
Jan 1 at 4:20





Why on Earth do people use numbers to set file permissions? "chmod [ugo][+-][rwx] works perfectly well for most cases (and there are options for less common ones - read the man page), and is almost impossible to forget.

– jamesqf
Jan 1 at 4:20










1 Answer
1






active

oldest

votes


















4














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
    Dec 31 '18 at 22:12






  • 4





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

    – Stephen Harris
    Dec 31 '18 at 22:16










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

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














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
    Dec 31 '18 at 22:12






  • 4





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

    – Stephen Harris
    Dec 31 '18 at 22:16















4














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
    Dec 31 '18 at 22:12






  • 4





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

    – Stephen Harris
    Dec 31 '18 at 22:16













4












4








4







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 Dec 31 '18 at 22:12

























answered Dec 31 '18 at 22:09









Stephen HarrisStephen Harris

25.4k24477




25.4k24477












  • Any idea what the S_I prefix stands for?

    – undercat
    Dec 31 '18 at 22:12






  • 4





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

    – Stephen Harris
    Dec 31 '18 at 22:16

















  • Any idea what the S_I prefix stands for?

    – undercat
    Dec 31 '18 at 22:12






  • 4





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

    – Stephen Harris
    Dec 31 '18 at 22:16
















Any idea what the S_I prefix stands for?

– undercat
Dec 31 '18 at 22:12





Any idea what the S_I prefix stands for?

– undercat
Dec 31 '18 at 22:12




4




4





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

– Stephen Harris
Dec 31 '18 at 22:16





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

– Stephen Harris
Dec 31 '18 at 22:16

















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.




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

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?