Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

into filesize for conversions

Convert value to filesize.

Signature

> into filesize {flags} ...rest

Parameters

  • ...rest: For a data structure input, convert data at the given cell paths.

Input/output types:

inputoutput
intfilesize
numberfilesize
stringfilesize
filesizefilesize
tabletable
recordrecord
list<int>list<filesize>
list<number>list<filesize>
list<string>list<filesize>
list<filesize>list<filesize>
list<any>list<filesize>

Examples

Convert string to filesize in table

> [[device size]; ["/dev/sda1" "200"] ["/dev/loop0" "50"]] | into filesize size
╭───┬────────────┬───────╮
│ # │   device   │ size  │
├───┼────────────┼───────┤
│ 0 │ /dev/sda1  │ 200 B │
│ 1 │ /dev/loop0 │  50 B │
╰───┴────────────┴───────╯

Convert string to filesize

> '2' | into filesize
2 B

Convert float to filesize

> 8.3 | into filesize
8 B

Convert int to filesize

> 5 | into filesize
5 B

Convert file size to filesize

> 4KB | into filesize
4.0 kB

Convert string with unit to filesize

> '-1KB' | into filesize
-1.0 kB