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 more Command: View Text One Screen at a Time

Linux more Command: View Text One Screen at a Time

Learn how to use Linux more to read text one screen at a time, move and search interactively, start at a line or pattern, and choose between more and less.

Linux paste Command: Join Corresponding Lines Side by Side

Linux paste Command: Join Corresponding Lines Side by Side

Learn how to join Corresponding Lines Side by Side with the Linux paste command, including practical examples, key options, and important precautions.

Linux bzip2 Command: Compress a File in bzip2 Format

Linux bzip2 Command: Compress a File in bzip2 Format

Learn how to compress a File in bzip2 Format with the Linux bzip2 command, including practical examples, key options, and important precautions.

Linux Tutorial / PID and PPID Explained: Find and Manage Processes

Linux Tutorial / PID and PPID Explained: Find and Manage Processes

Understand what PID and PPID mean, inspect parent-child process relationships with ps and pgrep, and safely terminate a process you started yourself.

Linux cp Command: Copy Files and Directories

Linux cp Command: Copy Files and Directories

Learn how to copy files and directories with Linux cp, control overwrites, preserve attributes, handle symlinks, and verify important copies.

Linux Directory Structure Explained: Purpose of Major Directories

Linux Directory Structure Explained: Purpose of Major Directories

Understand the purpose of major Linux directories such as /etc, /var, /usr, /home, /proc, and /sys, and learn where common system files belong.

Linux whereis Command: Locate Binaries, Source, and Man Pages

Linux whereis Command: Locate Binaries, Source, and Man Pages

Learn how Linux whereis locates binaries, source files, and manual pages, limits each search type, lists effective paths, and differs from which and find.

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 ethtool Command: Inspect Network Link and Driver Settings

Linux ethtool Command: Inspect Network Link and Driver Settings

Learn how to inspect Network Link and Driver Settings with the Linux ethtool command, including practical examples, key options, and important precautions.

Linux blkid Command: Find Block-Device UUIDs and Filesystem Types

Linux blkid Command: Find Block-Device UUIDs and Filesystem Types

Learn how to find Block-Device UUIDs and Filesystem Types with the Linux blkid command, including practical examples, key options, and important precautions.