Try ps aux
. It displays a nice clean output sorted by cpu usage. If you want something even less cluttered, try
ps aux | awk '';
To understand this command, just run ps aux
, and look at the output. The variable $3
refers to the third column of the output. You can add or remove columns from GeekTool by adding or removing these variables from the command. The large amount of whitespace between the quotation marks just changes the spacing between the columns in the output.
If you want more options, check out the man page by typing man ps
. (You can do this for top
too. If you're wondering why I didn't suggest a modification using top
, it is due to the following issues:
The problem with GeekTool is that it requires output from a command that is static. top
can be made to give a static output by using top -l 1
, but because it is only making one sample, it can't get the cpu usage. (It needs at least two for that.) You will notice that if you run top -l 1
, your cpu usage will be displayed as 0. To rectify that, you can use top -l 2
. However this displays the system usage twice, and only the second set of data is correct. This probably wouldn't be helpful for GeekTool. If you still really want to use top
, you can try out the following command: top -l 2 -o cpu -R -stats cpu,command
. However, it will only display the incorrect data, because it prints that first.