Useful Linux Command Aliases

# Create an alias command lsn to display files with numerical representation of schmod permissions
alias lsn="stat -c '%a %n' *"

# ls with numerical chmod 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}'
Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *