I want to convert the output of the command ps
to JSON in order to process it as structured data (with jq in this particular case). How do I do that?
The output looks like the following:
PID TTY TIME CMD
20162 pts/2 00:00:00 ps
28280 pts/2 00:00:02 zsh
The header row is always present.