Letting "ls -l" display file permissions in octal

Chris H bsd-lists at bsdforge.com
Tue Apr 8 19:32:37 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.

+1 for incorporating it, and adding it to BASE.

--Chris

>
> 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.
>



More information about the freebsd-hackers mailing list