1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 22:22:18 +02:00
tldr/pages/common/numfmt.md
K.B.Dharun Krishna 898f711019
pages/*: update GNU coreutils links, sync translation pages (#15543)
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2025-01-18 18:45:33 +05:30

455 B

numfmt

Convert numbers to and from human-readable strings. More information: https://www.gnu.org/software/coreutils/manual/html_node/numfmt-invocation.html.

  • 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"