Display numeric file permissions

I was *really* hoping ls would have a flag to show file permissions in octal, but it doesn’t.

However, there is another way!

$ stat -c "%a %n" *

This will list all of the files in the current directory along with their numeric permissions.

For example, this -rw-rw-r-- turns into this 664.

Tested on RHEL5 and Fedora 4.


2 Responses to Display numeric file permissions

  1. Jakob says:

    This was posted on May 15th, 2009 but still tested on Fedora 4? Get with the times please :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: