Column Command
TLDR: column is a linux cli that lets you output stuff in columns
Stumbled across a video on YouTube
the column command will take output and let you put it into columnar to make it easier to read. It also has a table command -t to display it as a table.
You can also output as json with the -J command
You can run something like
cat /etc/passwd | column -t -s ":" -N USER,PW,UID,GUID,X,HOME,SHELL -H PW,X
This will output a table of the users on a system with their
- Username
- User ID
- Group ID
- Home Directory
- Shell on login
Or you can output json like this
cat /etc/passwd | column -J -N User,PW,UID,GUID,X,HOME,SHELL -H PW,XThis command can really help to make data more readable when interacting with it on a system. It can also allow you to output json from a system to be used with a REST API, or something similar
I learned it from this video