Is there a way you can find the percentage of CPU time used by a process on the command line?

Also I want to find out what the cpu time is by a certain process as well as the percentage of memory that that process is using by using the command line.

  • 1
    have you tried the command top? Nov 7 '14 at 16:53

If you know the process ID (pid), then you can run:

top -p <pid1>,<pid2>...

And to get the list of process IDs for a given process name you can use:

pgrep <process-name>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.