Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 2008 19:49:22 -0500
From:      "Paul A. Procacci" <pprocacci@datapipe.com>
To:        Modulok <modulok@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Can one list permission bits numerically...
Message-ID:  <47DC6E92.1000300@datapipe.com>
In-Reply-To: <64c038660803151511r6ae6d229v484769cfe38043bc@mail.gmail.com>
References:  <64c038660803151511r6ae6d229v484769cfe38043bc@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47DC6E92.1000300>