Blog.

How to get permissons of a file/directory

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

 

Linux:

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

The output is as follows:

/tmp 1777 drwxrwxrwt

 

 

Mac OS X:

stat -f "%N %A %Sp" /private/tmp # replace /private/tmp with your file/dir

The output is as follows:

/private/tmp 1777 drwxrwxrwt

 

 

saki
Follow me:
Latest posts by saki (see all)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your username and password to log into your account. Don't have an account? Sign up.

Want to collaborate on an upcoming project?