mirror of
https://github.com/nushell/nushell.git
synced 2024-11-29 20:03:54 +01:00
c0a1d18e3d
* feat: update #4455, regenerate commands' docs * chore: update make_docs script
28 lines
431 B
Markdown
28 lines
431 B
Markdown
---
|
|
title: format
|
|
layout: command
|
|
version: 0.59.0
|
|
---
|
|
|
|
Format columns into a string using a simple pattern.
|
|
|
|
## Signature
|
|
|
|
```> format (pattern)```
|
|
|
|
## Parameters
|
|
|
|
- `pattern`: the pattern to output. e.g.) "{foo}: {bar}"
|
|
|
|
## Examples
|
|
|
|
Print filenames with their sizes
|
|
```shell
|
|
> ls | format '{name}: {size}'
|
|
```
|
|
|
|
Print elements from some columns of a table
|
|
```shell
|
|
> echo [[col1, col2]; [v1, v2] [v3, v4]] | format '{col2}'
|
|
```
|