mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
36 lines
886 B
Plaintext
36 lines
886 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# column
|
|
|
|
> Format `stdin` or a file into multiple columns.
|
|
> Columns are filled before rows; the default separator is a whitespace.
|
|
> More information: <https://manned.org/column>.
|
|
|
|
- Format the output of a command for a 30 characters wide display:
|
|
|
|
`printf "header1 header2
|
|
bar foo
|
|
" | column {{[-c|--output-width]}} {{30}}`
|
|
|
|
- Split columns automatically and auto-align them in a tabular format:
|
|
|
|
`printf "header1 header2
|
|
bar foo
|
|
" | column {{[-t|--table]}}`
|
|
|
|
- Specify the column delimiter character for the `--table` option (e.g. "," for CSV) (defaults to whitespace):
|
|
|
|
`printf "header1,header2
|
|
bar,foo
|
|
" | column {{[-t|--table]}} {{[-s|--separator]}} {{,}}`
|
|
|
|
- Fill rows before filling columns:
|
|
|
|
`printf "header1
|
|
bar
|
|
foobar
|
|
" | column {{[-c|--output-width]}} {{30}} {{[-x|--fillrows]}}`
|