Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Dan Drake 馃
Dan Drake 馃
@ddrake@mathstodon.xyz  路  activity timestamp 2 weeks ago

I know I posted about this but can't find it (aha, found it: https://mathstodon.xyz/@ddrake/112784707289030020 on the "numfmt" utility) -- but today I learned of the --human-numeric-sort option to the GNU "sort" command!

"sort -h" is smart about suffixes: it knows that 999K is less than 1M, and so on.

It's obviously designed to handle input from things like "du -h", which means

du -h | sort -h

does exactly what you want!

#linux #terminal

  • Copy link
  • Flag this post
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct