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
A variant of caf's answer: top -p
top -p
This auto-refreshes the CPU usage so it's good for monitoring.