Created
October 13, 2017 18:10
-
-
Save nikola-bodrozic/8a9be1fc2eb79ffb2fc15c8e8515c689 to your computer and use it in GitHub Desktop.
List numeric permissions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ls -la | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment