Site icon New Generation Enterprise Linux

Taming Terminal Output: The `column` Command for Clean Layouts

Quick Tip

Taming Terminal Output: The `column` Command for Clean Layouts

Challenge: When listing files, directories, or command output with multiple columns, the default formatting can often be messy and difficult to read, especially when dealing with varying column widths.

The Solution: The `column` command can be used to format lists into neat, aligned columns.

ls -l | column -t

Why it works: The `column -t` option creates a table by determining the number of columns and their widths automatically, aligning the output for better readability. This is particularly useful when piping output from other commands that might produce variable-width data.

Pro-Tip: Combine `column` with `sort` for perfectly aligned, sorted lists. For example: ls -l | sort -k 5 -n | column -t sorts by file size and then formats into columns.

Linux Tips & Tricks | © ngelinux.com | 5/13/2026

0 0 votes
Article Rating
Exit mobile version