mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-04 23:15:33 +02:00
numfmt: add page (#2386)
This commit is contained in:
parent
d45fb16354
commit
3d2fc22207
1 changed files with 15 additions and 0 deletions
15
pages/linux/numfmt.md
Normal file
15
pages/linux/numfmt.md
Normal file
|
@ -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"}}`
|
Loading…
Add table
Reference in a new issue