View Permission all file in directory with Number

Mac OSX 4 ก.ย. 2018

This can be used to list all directory files with their permissions:

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}'

ref: https://askubuntu.com/questions/152001/how-can-i-get-octal-file-permissions-from-command-line

แท็ก

Onyx

Just a middle-aged programmer, Can do many things but not the most.