I want to show only specific columns for all the records in the command.
Example: docker ps
shows me data in 10 columns. It can have space in between the column headers. My requirement is to get only 2-4 columns in some sequence.
Is there a direct way to do that in any of the commands that respond in a tabular way?
I am new to Linux and thinking if this can be feasible. Thanks.
For example:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED NAMES
123 image "ABC DEF" 10 hours ago image ABC
Here in the above scenario, CONTAINER ID
is one header column but there is space, and in the row for NAMES
columns can have space in between.
Using AWK
, CUT
etc it is trickier to write a common script for all the commands because they work on "space" logic.