File listing in octal
Posted by gregster on 27 Jun 2013 in R & D
After a conversation with Martin about why there's no flag for 'ls' that retrieves permissions in octal form, I added an alias to do this for me.
To create the alias, do this:
alias oct="stat -c '%A[%a] %U:%G %s %.19z %n' $1"
Then, run it like this:
oct /usr/bin/*
and get back something like this:
-rwxr-xr-x[755] root:root 17792 2014-06-03 15:24:04 /usr/bin/xkbvleds
-rwxr-xr-x[755] root:root 16096 2014-06-03 15:24:04 /usr/bin/xkbwatch
-rwxr-xr-x[755] root:root 14659 2014-06-03 15:24:04 /usr/bin/xkeystone
-rwxr-xr-x[755] root:root 14640 2014-06-03 15:24:04 /usr/bin/xkill
-rwxr-xr-x[755] root:root 16016 2014-06-03 15:24:04 /usr/bin/xload