10

Tip #739   Display file permissions in octal

Tip 205 is an interesting way to show file permissions in octal using sed, but this can be done much easier using the Linux stat command.

From man page of Linux stat(1) command:
%A Access rights in human readable form
%a Access rights in octal
%n File name

stat -c '%A %a %n' *

Sample output:
-rwxr-xr-x 755 netp.sh
drwxr-xr-x 755 old_dump
-rw-r--r-- 644 tdiff.sh