So what im wanting to do is pretty basic.....but im not sure how to go about it. Lets say I have a program running, but I want to pipe the output of ps -C "ProgramXX" into a file.
Normally Running ps -C "ProgramXX" Produces something to the effect of:
PID TTY TIME CMD
123 ? 00:00:00 Program1
142 ? 00:00:00 Program1
165 ? 00:00:00 Program1
221 ? 00:00:00 Program1
Is their any "simple" way to just get the 1st columns and 4th column (ignoring the top heading line) into a text file.
I figure you could run ps -C "Program1" >> Data.txt.....then maybe run a script to cut out the fat? This would be done in Bash btw. Maybe using grep or something.....but I wouldn't really know. This would be ran multiple times btw......so data.txt would continue to grow.