Privacy Policy
© 2025 linux101.dev

column Command Cheatsheet

The column command is a simple but powerful utility used to format a list of data into neat, clean columns. It is most often used with a pipeline (`|`) to make the output of other commands more readable.

Common Usage

CommandDescription
cat file.txt | column -tReads the content of file.txt and formats it into a table. The -t flag is for table mode, which is the most common use case.
grep "pattern" files/* | column -tFinds lines matching a pattern and then uses column to display the results in a formatted table. This is very useful for reading log files or search results.
ls -1 | columnFormats a list of files (one per line) into multiple columns to better fit the terminal width.

Key `column` Options

OptionDescriptionExample
-tDetects the number of columns and formats the output into a table. This is the most popular option.ls -l | column -t
-s [SEPARATOR]Specifies a custom delimiter for the input. This is useful for parsing files that use separators other than whitespace, such as CSV files.awk '...' file.csv | column -s, -t
-c [WIDTH]Formats the output into a specified width. The command will wrap lines to fit within that width.cat file.txt | column -c 80