ls Verified current stable Not installed? Version Control

Ls / Format Stdin As Multiple Columns

Format Stdin As Multiple Columns

Formats input data into specified columnar structures for easier readability.

$
Terminal
ls | git column --mode=<column>

When To Use

When analyzing large logs or outputs that need to be interpreted in a tabular format.

Pro Tip

To improve performance, consider piping data through `grep` before formatting to reduce input size.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
ls | git column --mode=<column>

Anatomy of Output

Understanding the result

Entry 1 | Entry 2 Column Output

Displays correctly formatted entries in the specified number of columns.

------------|------------ Separator Line

Visual guide indicating the separation of columns.

More entries may be available... Continuation Message

Signifies that the input has additional entries not displayed.

Power User Variants

Optimized versions

ls | git column --sort

Sorts the output entries after formatting.

ls | git column --width=80

Specifies the width of the column output.

Troubleshooting

Common pitfalls

bash: column: command not found

Solution: Ensure that the `bsdmainutils` package is installed or use `apt install bsdmainutils`.

grep: missing operand

Solution: Provide a valid pattern for `grep`.

ls: cannot access 'ls': No such file or directory

Solution: Ensure the command preceding ls is correctly formatted and the path exists.

Command Breakdown

What each part is doing

ls
Base Command
The executable that performs this operation. Here it runs Ls before the shell applies any redirect operators.
<column>
column
The value supplied for column.
--mode=<column>
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative version control tools for the same job.