Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Display numeric permissions using ls ====== Create an alias for the LS command. <code bash>ls -l | 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}'</code> Output should be with the nummeric permissions at the beginning of each row: <code bash> adm@lxpssl:/home$ ls -l | 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}' total 3 755 drwxr-xr-x 2 adm domain users 1024 Mar 22 2016 adm 755 drwxr-xr-x 2 adm1 domain users 1024 Feb 11 2016 adm1 755 drwxr-xr-x 2 adm2 domain users 1024 Apr 11 2016 adm2 adm@lxpssl:/home$ </code> linux/shell_commands/chmod_nummeric.txt Last modified: 2019/10/31 09:05by 127.0.0.1