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
For those who struggled for a while wonderring why the selected answer does not work:
ps -p -o %cpu,%mem
No SPACE ibetween %cpu, and %mem.
%cpu,
%mem