Show Process CPU Usage

by Rick on

Display how much CPU a process is using:

ps -eo pcpu,pid -o comm= | sort -k1 -n -r | head -1

For example, show top five CPU using processes:

ps -eo pcpu,pid -o comm= | sort -k1 -n -r | head -5

Which will output the following:

0.6 24458 bash
0.3 24457 cphulkd.pl
0.2  7704 php5
0.1  7706 php5
0.1  7705 php5

Hide Sidebar