Linux "numfmt" Command Line Options and Examples
Convert numbers from/to human-readable strings

Reformat NUMBER(s), or the numbers from standard input if none are specified. Mandatory arguments to long options are mandatory for short options too.


Usage:

numfmt [OPTION]... [NUMBER]...




Command Line Options:

--debug
print warnings about invalid input
numfmt --debug ...
-d
use X instead of whitespace for field delimiter
numfmt -d ...
--field
replace the numbers in these input fields (default=1) see FIELDS below
numfmt --field ...
--format
use printf style floating-point FORMAT; see FORMAT below for details
numfmt --format ...
--from
auto-scale input numbers to UNITs; default is 'none'; see UNIT below
numfmt --from ...
--from-unit
specify the input unit size (instead of the default 1)
numfmt --from-unit ...
--grouping
use locale-defined grouping of digits, e.g. 1,000,000 (which means it has no effect in the C/POSIXlocale)
numfmt --grouping ...
--header[
print (without converting) the first N header lines; N defaults to 1 if not specified
numfmt --header[ ...
--invalid
failure mode for invalid numbers: MODE can be: abort (default), fail, warn, ignore
numfmt --invalid ...
--padding
pad the output to N characters; positive N will right-align; negative N will left-align; padding isignored if the output is wider than N; the default is to automatically pad if a whitespace is found
numfmt --padding ...
--round
use METHOD for rounding when scaling; METHOD can be: up, down, from-zero (default), towards-zero, near‐est
numfmt --round ...
--suffix
add SUFFIX to output numbers, and accept optional SUFFIX in input numbers
numfmt --suffix ...
--to
auto-scale output numbers to UNITs; see UNIT below
numfmt --to ...
--to-unit
the output unit size (instead of the default 1)
numfmt --to-unit ...
-z
line delimiter is NUL, not newline
numfmt -z ...
--help
display this help and exit
numfmt --help ...
--version
output version information and exitUNIT options:none no auto-scaling is done; suffixes will trigger an errorauto accept optional single/two letter suffix:1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576,si accept optional single letter suffix:1K = 1000, 1M = 1000000, ...iec accept optional single letter suffix:1K = 1024, 1M = 1048576, ...iec-i accept optional two-letter suffix:1Ki = 1024, 1Mi = 1048576, ...FIELDS supports cut(1) style field ranges:N N'th field, counted from 1
numfmt --version ...
-M
from N'th to M'th field (inclusive)
numfmt -M ...
-
Multiple fields/ranges can be separated with commasFORMAT must be suitable for printing one floating-point argument '%f'. Optional quote (%'f) will enable
numfmt - ...