mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-24 17:52:17 +00:00
Update cheatsheets
This commit is contained in:
21
numfmt
Normal file
21
numfmt
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# numfmt
|
||||
|
||||
> Convert numbers to and from human-readable strings.
|
||||
> More information: <https://www.gnu.org/software/coreutils/numfmt>.
|
||||
|
||||
- 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}}"`
|
||||
Reference in New Issue
Block a user