coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octal file permissions in ls


From: Pádraig Brady
Subject: Re: Octal file permissions in ls
Date: Mon, 18 Mar 2013 19:30:57 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 03/18/2013 04:43 PM, Sakse Dalum wrote:
> Hi there,
> 
> I recently found myself wanting ls to show file permissions in octal format, 
> so
> I decided to implement the feature. Being somewhat unfamiliar with C coding 
> and
> C coding standards in particular, I've hunched my way through the 
> implementation
> method, but seeing that it's only a few lines of code, it shouldn't break
> anything as far as I can see.
> 
> Anywho, I've attached a diff to this mail, which may or may not be applicable 
> to
> the most recent version (I just did an apt-get source in Trisquel 6.0 to get 
> the
> source for coreutils).

Thanks for the patch.
It's a close call as to whether this is needed,
but the current consensus is that it isn't needed.

There was a previous discussion that `stat -c %a` suffices:
  http://lists.gnu.org/archive/html/coreutils/2011-04/msg00036.html

Also one can use find(1) to output octal permissions:
  find -printf "%m %p\n

thanks,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]