Suppose I have a ps
command that looks like this:
ps -Ao args:80,time,user --sort time
It will give me a "space" separated set of rows. A row might look like this
paulnath -bash 00:00:00
I would like to convince ps to delimit by commas(or tabs even!), such that it can be processed automagically by other languages. Please note that args will probably have spaces in it, so, awking by field won't per se work.
Once open, click File and choose Save As. Under Save as type, select CSV (Comma delimited) or CSV (Comma delimited) (*.
To do this, just add the > character and the name of the file where you want the output to be stored to the end of the command. If the output file doesn't already exist, > will create that file. If that file exists, > will replace its contents with the new output.
The “-ef” option of the “ps” command is used to print all the processes running on the system in the standard format.
You can use the following syntax to put your own delimiter:
ps -Ao "%U,%t,%a"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With