Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)
I want to get my CPU and memory usage of the single process on Linux - I know to use the PID. Hopefully, I can get it every second and write it to the CSV using a 'watch' command. What command can I use to get some information from my Linux command-line?

1 Answer

0 votes
by (36.8k points)

Use the command:

ps -p <pid> -o %cpu,%mem,cmd

(You can leave off "cmd" but that might help debug).

Note that gives average CPU usage of this process over time it has been running.

Come and join Linux training to gain great knowledge. 

Do check out the video below

 

 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...