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

This alias is handy.

alias octal="stat -c '%a %A %n'"

Stay up to date

Sign up for the mailing list and get notified via email when new blog posts come out.