linux:shell_commands:numeric_permissions

Show numeric permissions on ls

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}'
Enter your comment:
T S J I L
 
  • linux/shell_commands/numeric_permissions.txt
  • Last modified: 2019-10-31 09:05
  • (external edit)