Polecenia Linuksa

Linux Column Command

Linux Column Command
While using Linux distributions, some of the data needs to be displayed in columnar format. Linux system makes it easy to display content in columns using the “column” command.

The “column” command is a simple command-line utility to print the file contents in columns. This command-line tool supports multiple options containing proper functionality that are worth considering.

When using the “column” command in a terminal, it ignores blank lines by default.

If we have data displayed in multiple columns, the command will start to display the data from the left side to the right side i-e; it will begin to add content in the left column first and then move towards the right columns.

Syntax of Column Command:

The syntax of the Linux “column” command is:

“column [-entx] [-c columns] [-s sep] [file name… ]”

Column Command Options:

Let's create a file named “test.txt” and add some content to it.

For example, we have some content in the “test.txt” file.

So, the output of this text file should be printed in columns. Type the column command with the file name, and your output would be:

$ column test.txt

If you have content in a file where a particular delimiter separates entries, use the “-s” option with “-t.”

When we use this command, it will remove the delimiter and produce output in a columnar format.

Let's see how this option works. For example, we have a file “file.txt” containing the following data with delimiter “|”:

Now, use the following command to check the output:

$ column file.txt -t -s “|”

To print a help message related to the “column” command, use the “-help” command, and it shows all options in the terminal with functions.

$ column --help

Check the version of the “column” command using the “-version” option.

$ column --version

Other Useful Options of Column Command:

Conclusion:

The “column” command is a command-line utility introduced by the Linux system to display output in a columnar format. This guide discussed column command briefly and learned how to use it with different options.

Gry 5 najlepszych gier zręcznościowych dla systemu Linux
5 najlepszych gier zręcznościowych dla systemu Linux
W dzisiejszych czasach komputery to poważne maszyny używane do gier. Jeśli nie możesz uzyskać nowego wysokiego wyniku, będziesz wiedział, o co mi chod...
Gry Bitwa o Wesnoth 1.13.6 Wydanie rozwojowe
Bitwa o Wesnoth 1.13.6 Wydanie rozwojowe
Bitwa o Wesnoth 1.13.6 wydana w zeszłym miesiącu jest szóstą wersją rozwojową w 1.13.Seria x i zapewnia szereg ulepszeń, w szczególności w interfejsie...
Gry Jak zainstalować League Of Legends na Ubuntu 14.04
Jak zainstalować League Of Legends na Ubuntu 14.04
Jeśli jesteś fanem League of Legends, to jest okazja do przetestowania League of Legends. Pamiętaj, że LOL jest obsługiwany w PlayOnLinux, jeśli jeste...