LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   find out chmod of file or directory (http://www.linuxquestions.org/questions/linux-newbie-8/find-out-chmod-of-file-or-directory-922869/)

ggalan 01-09-2012 10:06 AM

find out chmod of file or directory
 
is it possible to find out what the chmod number is on a file or directory?
Code:

ls -l
gives me something like this
Code:

drwxr-xr-x
but would like numbers

thanks

Ian John Locke II 01-09-2012 10:11 AM

Quote:

Originally Posted by ggalan (Post 4570232)
is it possible to find out what the chmod number is on a file or directory?
Code:

ls -l
gives me something like this
Code:

drwxr-xr-x
but would like numbers

thanks

From
Code:

drwxr-xr-x
it's easy to figure out what the number is. Each
Code:

rwx
is an octet, i.e, those three letters can form a value of no more than 7 and no less than 0. If you know binary then you should know that 100 = 4, 010 = 2, and 001 = 1. Then just think of the following r = 4, w = 2, and x = 1. So for your example, the permissions in numeric form are
Code:

d755


All times are GMT -5. The time now is 02:05 PM.