Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I enable this for GNU ls like:

    alias ls="BLOCK_SIZE=\'1 ls --color=auto"
The above is a bit hacky and not very UNIXy as it's lumping more logic into ls, rather than splitting out into functional units.

Number formatting being a very common requirement, I've proposed a design for a new numfmt GNU coreutil

http://lists.gnu.org/archive/html/coreutils/2012-02/msg00085...

which would be used like:

    ls -l | numfmt --field=5 --format=%'d


I really don't understand why block size is 512 by default. It should really be 1 by default.

Except for someone with an ancient hard disk who thinks in blocks instead of (mega, giga, etc...)bytes, who ever needs or wants that?


512 byte blocks for ls is specified by POSIX. That would probably be a painful change now.


Why not

    alias ls="ls --block-size=\'1 --color=auto"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: