unix - Shell script for "top" followed by pressing 1 , it will give me per core CPU usage -


i looking way create script below task.

1.top 2.press 1

it gives me per cpu usage below output.

mem: 631660k used, 500644k free, 0k shrd, 3972k buff, 313252k cached cpu0: 28.5% usr 0.0% sys 0.0% nic 0.0% idle 71.4% io 0.0% irq 0.0% sirq cpu1: 0.0% usr 37.5% sys 0.0% nic 62.5% idle 0.0% io 0.0% irq 0.0% sirq cpu2: 0.0% usr 16.6% sys 0.0% nic 66.6% idle 0.0% io 0.0% irq 16.6% sirq cpu3: 12.5% usr 87.5% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq load average: 3.87 3.23 2.54 3/335 13152 pid ppid user stat vsz %vsz %cpu command 949 943 apps r 139m 12.6 28.8 egtpuapp 0 0 26 2 root rw<
0 0.0 9.6 [kworker/3:0h]

i have basic version of top , other utitities , expect not there. in case can creating script take samples of above command file helpfull.

my top info: usage: top [-b] [-ncount] [-dseconds]

provide view of process activity in real time. read status of processes /proc each seconds , display screenful of them. keys: n/m/p/t: sort pid/mem/cpu/time r: reverse sort 1: toggle smp q,^c: exit

options: -b batch mode -n n exit after n iterations -d n delay between updates

on system not able create toprc file. in advance. -vishal


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -