How to get permissons of a file/directory

22. April 2008 – 14:13

If you want to see permissions of a file or a directory in both human readable and octal notation issue this command:

stat -c "%n %a %A" /tmp # replace /tmp with your file/dir

The output is as follows:

/tmp 1777 drwxrwxrwt

StumbleUpon Toolbar
  1. 3 Responses to “How to get permissons of a file/directory”

  2. For everybody that can\’t figure it out on their own, the closing quotation mark after the format is missing – it should read:

    stat -c \

    By rene on Apr 25, 2008

  3. Bah! That\’s not what it should read :)

    Since I don\’t want to spam comments trying to figure out how to escape the quotes, I\’ll just leave you with the instruction to add a quote after the format without explicit example.

    Please feel free to remove these two comments, once it\’s fixed, Saki.

    By rene on Apr 25, 2008

  4. No problem with your comments. I’ll correct that post.

    Thank you for pointing out this typo. :)

    By jsakalos on Apr 26, 2008

Post a Comment