From 3d2fc222074561ab3b0e5ae4e9d18eb4e0c0cc38 Mon Sep 17 00:00:00 2001 From: Russ Edwards Date: Thu, 4 Oct 2018 13:07:53 -0400 Subject: [PATCH] numfmt: add page (#2386) --- pages/linux/numfmt.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/linux/numfmt.md diff --git a/pages/linux/numfmt.md b/pages/linux/numfmt.md new file mode 100644 index 0000000000..50b3826ce3 --- /dev/null +++ b/pages/linux/numfmt.md @@ -0,0 +1,15 @@ +# 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"}}`