format filesize

For strings.

Converts a column of filesizes to some specified format.

Command Type

built-in

Signature

> format filesize {flags} (format value) ...rest

Parameters

  • format value: The format into which convert the file sizes.
  • ...rest: For a data structure input, format filesizes at the given cell paths.

Input/output types:

input output
filesize string
table table
record record

Examples

Convert the size column to KB.

> ls | format filesize kB size

Convert the apparent column to B.

> du | format filesize B apparent

Convert the size data to MB.

> 4GB | format filesize MB
4000 MB

Notes

Decimal precision is controlled by $env.config.float_precision.

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.