Page 1 of 1

Re: Terminal command to get CPU usage?

Posted: 2018-08-28 14:02
by None1975
THX1138b wrote:Can anyone help me with a console command to get CPU usage?
Or would it be easier to use a simple top command?

Re: Terminal command to get CPU usage?

Posted: 2018-09-13 09:05
by oswaldkelso
I've been using the above script on one of my machines since seeing it in this thread. It certainly felt snappier and gave similar results to the previous script.

Today however I ran ps_mem I noticed after prolonged use it's memory usage had grown.

Code: Select all

  5.9 MiB + 664.5 KiB =   6.5 MiB	wmaker (2)
 10.5 MiB +   1.4 MiB =  11.9 MiB	wicd-client
 12.6 MiB +   1.7 MiB =  14.2 MiB	Xorg
 15.0 MiB +   1.8 MiB =  16.8 MiB	lilyterm
 20.4 MiB + 175.0 KiB =  20.5 MiB	cpu-usage.sh
 50.6 MiB + 137.0 KiB =  50.7 MiB	weechat-curses
---------------------------------
                        180.1 MiB
=================================

Code: Select all

└> $ uptime
 10:24:24 up 18 days, 12:12,  3 users,  load average: 0.61, 1.12, 1.38
┌—————————(kelsoo)————————<<<<(~) (Thu Sep 13 10:24:24) 
└> $ 
Any ideas?

Re: Terminal command to get CPU usage?

Posted: 2018-09-13 16:40
by Head_on_a_Stick
oswaldkelso wrote:Any ideas?
Use conky, perhaps?

Or something like slstatus — that consumes about 0.5MiB in my systems, although my maximum uptime tends to be less than a day.

Re: Terminal command to get CPU usage?

Posted: 2018-09-14 03:46
by debiman
oswaldkelso wrote:
I've been using the above script on one of my machines since seeing it in this thread. It certainly felt snappier and gave similar results to the previous script.

Today however I ran ps_mem I noticed after prolonged use it's memory usage had grown.

Code: Select all

  5.9 MiB + 664.5 KiB =   6.5 MiB	wmaker (2)
 10.5 MiB +   1.4 MiB =  11.9 MiB	wicd-client
 12.6 MiB +   1.7 MiB =  14.2 MiB	Xorg
 15.0 MiB +   1.8 MiB =  16.8 MiB	lilyterm
 20.4 MiB + 175.0 KiB =  20.5 MiB	cpu-usage.sh
 50.6 MiB + 137.0 KiB =  50.7 MiB	weechat-curses
---------------------------------
                        180.1 MiB
=================================
you use the version from that web page, exactly, no changes?

what do the fields in ps_mem output represent? you have heard about "Linux Ate my RAM", yes?

Re: Terminal command to get CPU usage?

Posted: 2018-09-14 07:04
by oswaldkelso
Exactly with no changes. Yes. I know about "Linux Ate my RAM"

I run a lot of old and low end hardware (256MB>3000MB) RAM usage is very noticeable on how well they run.