1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 14:02:08 +02:00
tldr/pages/linux/numfmt.md
2018-10-04 22:37:53 +05:30

381 B

numfmt

Convert numbers to and from human-readable strings.

  • Convert 1.5K (SI Units) to 1500:

numfmt --from={{si}} {{1.5K}}

  • Convert 5th field (1-indexed) to IEC Units without converting header:

ls -l | numfmt --header={{1}} --field={{5}} --to={{iec}}

  • Convert to IEC units, pad with 5 characters, left aligned:

du -s * | numfmt --to={{iec}} --format={{"%-5f"}}