1752536 Members
5017 Online
108788 Solutions
New Discussion юеВ

Re: file permission

 
SOLVED
Go to solution
Sac_3
Frequent Advisor

file permission

Hi ,

How to view the permissions of a file in octal format. i.e

-rwx------ 1 root root 0 Dec 4 08:31 test

The file permission for the file "test" is 700. I would like to know if there is a command etc which can display the file permission in octal format i.e as "700".

Thanks,
SaC
4 REPLIES 4
~sesh
Esteemed Contributor
Solution

Re: file permission

You can use the stat command.

E.g.

stat --format=%a

View man page for the stat command for more information.
Ivan Ferreira
Honored Contributor

Re: file permission

You can also use the short format:

stat -c %a
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Sac_3
Frequent Advisor

Re: file permission

Yes! by using stat name u can see the permissions in octal format.

got the answer!
Thx every one!!
Sac_3
Frequent Advisor

Re: file permission

:o)