Linux column Command: Format Text as a Table

column arranges uneven text into columns that are easy to read. util-linux's column -t adjusts the width of separated fields to create a table that is easy to read in the terminal.

What is the column command?

This is a command that changes the display format, not a parser that structurally validates data. The output width, line wrapping of long values, and color handling may vary depending on the version of util-linux. If the command is not available, a separate package may need to be installed.

Basic syntax

column [option] [file...]

The installed implementation and options may vary depending on the distribution. Check the description for your current system with man column.

Examples

Aligning space-separated tables

It calculates the field width to align columns.

column -t packages.txt

Colon-separated input

Specify the input delimiter with -s and create a table format with -t.

column -s ':' -t /etc/passwd

Command Output Formatting

Displays the results received from standard input in a way that is easy to read on the terminal.

printf 'name score\nkim 90\nlee 85\n' | column -t

Checking Table Format Output

column -t calculates the width of input columns and aligns them with spaces. The following example sorts two space-separated columns.

printf 'NAME AGE\nAna 7\nBenjamin 12\n' | column -t

Example output (the number of spaces may vary depending on the implementation):

NAME      AGE
Ana       7
Benjamin  12

The display is easy for humans to read, but it is not a format for safely exporting structured data. If a script needs to re-parse the columns, maintain a clear delimiter format such as tabs, CSV, or JSON instead of relying on space-aligned results. The range of options supported by column may vary depending on the distribution.

Main Options and Format

Options/Format Description
-t Formats the input as a table.
-s delimiter Specifies the delimiter of the input fields.
-o delimiter Specifies the delimiter between output columns.
-x Changes the default column filling direction to row-first.

Precautions when using

Even if the numbers appear aligned, do not trust this as a data exchange format. The output can vary depending on the terminal width or version. Complex formats like CSV quoting rules do not fit this simple example.

Frequently Asked Questions

What to do if you get a message that the column command is not found?

Check whether the package that provides column from util-linux is installed on your distribution. The package name may vary depending on the distribution.

Official Documentation

For the exact behavior of the options and implementation differences, refer to the official documentation for column.

More in This Category
Linux tee Command: Display and Save Pipeline Output

Linux tee Command: Display and Save Pipeline Output

Learn how to display and Save Pipeline Output with the Linux tee command, including practical examples, key options, and important precautions.

Linux dnf Command: Manage RPM Distribution Packages

Linux dnf Command: Manage RPM Distribution Packages

Learn how to manage RPM Distribution Packages with the Linux dnf command, including practical examples, key options, and important precautions.

Linux ip Command: Inspect and Configure Network Interfaces and Routes

Linux ip Command: Inspect and Configure Network Interfaces and Routes

Learn how to inspect and Configure Network Interfaces and Routes with the Linux ip command, including practical examples, key options, and important precautions.

Linux Tutorial / Search and Process Text with grep, sort, uniq, cut, and wc

Linux Tutorial / Search and Process Text with grep, sort, uniq, cut, and wc

Practice searching, sorting, grouping, extracting, and counting text with grep, sort, uniq, cut, and wc, including reproducible output and key caveats.

Linux umask Command: Control Default File Permissions

Linux umask Command: Control Default File Permissions

Learn how to control Default File Permissions with the Linux umask command, including practical examples, key options, and important precautions.

Linux dpkg Command: Inspect and Install Local DEB Packages

Linux dpkg Command: Inspect and Install Local DEB Packages

Learn how to inspect and Install Local DEB Packages with the Linux dpkg command, including practical examples, key options, and important precautions.

Linux watch Command: Run a Command Repeatedly

Linux watch Command: Run a Command Repeatedly

Learn how to use the Linux watch command to rerun a command at regular intervals and highlight changing output, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux whoami Command: Show the Effective User Name

Linux whoami Command: Show the Effective User Name

Learn how to show the Effective User Name with the Linux whoami command, including practical examples, key options, and important precautions.

Linux scp Command: Copy Files over SSH

Linux scp Command: Copy Files over SSH

Learn how to copy Files over SSH with the Linux scp command, including practical examples, key options, and important precautions.

Linux bunzip2 Command: Decompress bzip2 Files

Linux bunzip2 Command: Decompress bzip2 Files

Learn how to decompress bzip2 Files with the Linux bunzip2 command, including practical examples, key options, and important precautions.