W3cubDocs

/Nushell

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:

input output
filesize filesize
int filesize
list<any> list<filesize>
list<filesize> list<filesize>
list<int> list<filesize>
list<number> list<filesize>
list<string> list<filesize>
number filesize
record record
string filesize
table table

Examples

Convert string to filesize in table

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

Convert string to filesize

>'2'|into filesize
2B

Convert float to filesize

>8.3|into filesize
8B

Convert int to filesize

>5|into filesize
5B

Convert file size to filesize

>4KB|into filesize
3.9KiB

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/into_filesize.html