Home Explore Blog CI



nushell

commands/docs/format_filesize.md
5434663a6783521d7a5902e399ed1145e6cdd0e86478283e000000030000046e
---
title: format filesize
categories: |
  strings
version: 0.104.0
strings: |
  Converts a column of filesizes to some specified format.
usage: |
  Converts a column of filesizes to some specified format.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `format filesize` for [strings](/commands/categories/strings.md)

<div class='command-title'>Converts a column of filesizes to some specified format.</div>

## 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 |
| record   | record |
| table    | table  |
## Examples

Convert the size column to KB
```nu
> ls | format filesize KB size

```

Convert the apparent column to B
```nu
> du | format filesize B apparent

```

Convert the size data to MB
```nu
> 4GB | format filesize MB
4000 MB
```

Chunks
1311f9fe (1st chunk of `commands/docs/format_filesize.md`)
Title: format filesize: Convert file sizes to a specified format
Summary
The `format filesize` command converts file sizes to a specified format (e.g., KB, MB, GB, B). It can operate on a single filesize value, a column in a table, or specific cells within a record. The command takes the desired format as an argument and can also take cell paths to specify which file sizes to format in data structures.