//Tips tagged stat
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
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

View Comments »

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit