I want to get the CPU and memory usage of a single process on Linux - I know the PID. Hopefully, I can get it every second and write it to a CSV using the \'watch\' command
This is a nice trick to follow one or more programs in real time while also watching some other tool's output:
watch "top -bn1 -p$(pidof foo),$(pidof bar); tool"