Letting "ls -l" display file permissions in octal

A.J. 'Fonz' van Werven freebsd at skysmurf.nl
Tue Apr 8 18:53:30 UTC 2014


[Please CC me when you think it's necessary; I'm not subscribed to ]
[-hackers because I'm not a developer.                             ]

Someone asked on the FreeBSD Forums whether it was possible to let "ls -l"
display file permissions in octal, e.g.

  % ls -lO
  -0644  1 root  wheel  -  855B Mar  4 16:30 some_file

instead of

  % ls -l
  -rw-r--r--  1 root  wheel  -  855B Mar  4 16:30 some_file

Since ls itself appears not to have an option for that and I quite liked
the idea, I decided to hack the source of ls to do just that.

If you folks think this is a good idea, then by all means feel free to
discuss my patch and possibly incorporate it into the FreeBSD source tree.
And if you think it's not a good idea, no harm done. It's just a pet
project (and a simply one at that) so my feelings won't be hurt if it's
not accepted.

The patch can be found here: http://www.skysmurf.nl/attic/ls.patch

And the discussion thread in question on the FreeBSD Forums can be found
here: https://forums.freebsd.org/viewtopic.php?f=3&t=45825

Regards,

Alphons "Fonz" van Werven

-- 
I'm not completely useless, I can be used as a bad example.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20140408/12e15037/attachment.sig>


More information about the freebsd-hackers mailing list