How to get permissons of a file/directory

This is an archived post from the ExtJS era — the code may be obsolete, but the principles often still apply.

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

Linux:

The output is as follows:

Mac OS X:

The output is as follows:

3 comments

  1. reneApril 25, 2008archive
    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
  2. reneApril 25, 2008archive
    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.
  3. jsakalosApril 26, 2008archive
    No problem with your comments. I'll correct that post. Thank you for pointing out this typo. :)

Comments are closed on archived posts.