Get permission of a file/directory in numeric format

root@verma:[ji]> ls -ltr config.h
-rw-r--r-- 1 root root 33793 Apr 9 21:15 config.h

root@verma:[ji]> stat -c "%a %n" config.h
644 config.h

root@verma:[ji]> stat config.h
File: ‘config.h’
Size: 33793 Blocks: 72 IO Block: 4096 regular file
Device: 801h/2049d Inode: 4736045 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-04-16 11:07:40.600000000 +0000
Modify: 2017-04-09 21:15:13.808000000 +0000
Change: 2017-04-09 21:15:13.824000000 +0000
Birth: –

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s