To list file permissions in octal format, use stat command provided by the coreutils package. To get octal permissions of all the files and directories in the current working directory, run below command:
$ stat -c "%a %n" *
To get octal permissions of contents in a particular directory, say /usr/share, execute below command:
$ stat -c "%a %n" /usr/share/* 755 /usr/share/FirmwareUpdateKit 755 /usr/share/PackageKit 755 /usr/share/PolicyKit 755 /usr/share/X11 755 /usr/share/YaST2 ....
To get octal permissions only for the directory, say /usr/share, and not the content inside it, execute below command:
$ stat -c "%a %n" /usr/share/ 755 /usr/share/ $ stat -c "%a %n" /tmp 1777 /tmp $