Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Terminal command to get CPU usage?

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
User avatar
None1975
df -h | participant
df -h | participant
Posts: 1389
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 45 times
Been thanked: 66 times

Re: Terminal command to get CPU usage?

#16 Post 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?
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

User avatar
oswaldkelso
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1490
Joined: 2005-07-26 23:20
Location: UK
Has thanked: 1 time
Been thanked: 58 times

Re: Terminal command to get CPU usage?

#17 Post 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?
Free Software Matters
Ash init durbatulûk, ash init gimbatul,
Ash init thrakatulûk agh burzum-ishi krimpatul.
My oldest used PC: 1999 imac 333Mhz 256MB PPC abandoned by Debian

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Terminal command to get CPU usage?

#18 Post 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.
deadbang

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Terminal command to get CPU usage?

#19 Post 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?

User avatar
oswaldkelso
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1490
Joined: 2005-07-26 23:20
Location: UK
Has thanked: 1 time
Been thanked: 58 times

Re: Terminal command to get CPU usage?

#20 Post 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.
Free Software Matters
Ash init durbatulûk, ash init gimbatul,
Ash init thrakatulûk agh burzum-ishi krimpatul.
My oldest used PC: 1999 imac 333Mhz 256MB PPC abandoned by Debian

Post Reply