Show octal permissions of file or folder
You want to show octal permission of a file or a folder.
Use stat
stat -c "%a" file
> 664
stat -c "%a %A %n" file
> 664 -rw-rw-r-- readme.md
This alias is handy.
alias octal="stat -c '%a %A %n'"
Read other tils