Can one list permission bits numerically...

Paul A. Procacci pprocacci at datapipe.com
Sun Mar 16 00:49:51 UTC 2008


Modulok wrote:
> Perhaps I missed it somewhere in the man page, but is there a way to
> list files with their permission bits displayed as numeric (octal, as
> in chmod(1)), instead of symbolic? Something like:
>
> ls -lF -imaginaryFlag
>
> 0755  4 Modulok  Modulok     512 Dec 17 18:39 dir1/
> 0644  1 Modulok  Modulok  101786 Feb 23 05:53 file1
> 0644  1 Modulok  Modulok  140097 Feb 13 23:38 file2
> ....
>
> Thanks.
> -Modulok-
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>   
Maybe something like this will suit you:

stat -f "%p %l %u %g %z %m %N" *

It produces output similar to the following:

100755 1 0 0 64 1201845218 blah

The fields that I choose are in the man page, so it should be easy 
reading, and is pretty close to `ls -l`.

As for as `ls` having this ability, it doesn't.

Cheers.


More information about the freebsd-questions mailing list