How to remove the summary at the beginning of the “top” command in Linux?
Clash Royale CLAN TAG#URR8PPP
I used top -b -n 2 | awk 'if ($9 != 0.0) print $0,sed -n '8,20p''>>text.txt
, then the output is :
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
I wish to get the output like below (which means the header is not printed):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
Can anyone suggest a solution?
linux awk sed top
add a comment |
I used top -b -n 2 | awk 'if ($9 != 0.0) print $0,sed -n '8,20p''>>text.txt
, then the output is :
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
I wish to get the output like below (which means the header is not printed):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
Can anyone suggest a solution?
linux awk sed top
add a comment |
I used top -b -n 2 | awk 'if ($9 != 0.0) print $0,sed -n '8,20p''>>text.txt
, then the output is :
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
I wish to get the output like below (which means the header is not printed):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
Can anyone suggest a solution?
linux awk sed top
I used top -b -n 2 | awk 'if ($9 != 0.0) print $0,sed -n '8,20p''>>text.txt
, then the output is :
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31
Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie
%Cpu(s): 9.7 us, 1.6 sy, 0.0 ni, 88.5 id, 0.2 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 3938668 total, 2148708 used, 1789960 free, 133524 buffers
KiB Swap: 3903484 total, 0 used, 3903484 free. 822904 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
I wish to get the output like below (which means the header is not printed):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
1054 root 20 0 258664 3524 2692 S 0.5 0.1 0:00.00 rsyslogd
1086 root 20 0 258664 3524 2692 S 0.4 0.1 0:00.03 in:imuxsock
1087 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.00 in:imklog
1090 root 20 0 258664 3524 2692 S 0.3 0.1 0:00.05 rs:main Q:Reg
2452 fpiat 20 0 25292 7520 3580 S 0.3 0.2 0:00.69 bash
2495 fpiat 20 0 25088 6988 3256 S 0.3 0.2 0:00.05 bash
Can anyone suggest a solution?
linux awk sed top
linux awk sed top
edited Jan 14 at 15:28
Jeff Schaller
40.1k1054126
40.1k1054126
asked Jan 11 at 1:53
Shi Jie TioShi Jie Tio
1343
1343
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
The top
command is intended for interactive use. To get the output you want in a programmatic way, you might consider using ps
instead, which can give most of the same information but it is more script-friendly.
Example:
$ ps -eo pid,uid,pri,nice,vsz,rss,s,%cpu,%mem,time,comm | head
PID UID PRI NI VSZ RSS S %CPU %MEM TIME COMMAND
1 0 19 0 186380 9608 S 0.0 0.0 00:01:15 systemd
2 0 19 0 0 0 S 0.0 0.0 00:00:00 kthreadd
3 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_gp
4 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_par_gp
6 0 39 -20 0 0 I 0.0 0.0 00:00:00 kworker/0:0H-kblockd
8 0 39 -20 0 0 I 0.0 0.0 00:00:00 mm_percpu_wq
9 0 19 0 0 0 S 0.0 0.0 00:00:19 ksoftirqd/0
10 0 41 - 0 0 I 0.0 0.0 00:02:20 rcu_preempt
11 0 41 - 0 0 S 0.0 0.0 00:00:24 rcuc/0
Notice how the only field missing is SHR
. (I couldn't find out how to get ps
to print it.)
1
On the contrary, the manual for GNUtop
explicitly says that the-b
option is for sending output "to other programs".
– JdeBP
Jan 11 at 9:14
@JdeBP Okay, how well is that working for OP?
– cryptarch
Jan 11 at 10:30
@JdeBP I mean, if you think you have a better Answer ... where is it?
– cryptarch
Jan 11 at 10:33
You are constructing a false dilemma, when you could instead be fixing your answer. Your answer begins with an outright denial of what the manual for the command specifically says about the way that the questioner is using it. This is not an auspicious beginning to an answer.
– JdeBP
Jan 11 at 12:20
@JdeBP If you want to help me improve my answer, simply nitpicking over the manual is not the way to go. From what is posted in the question, it would appear that the manual contradicts observables. In the question we see that despite the use of-b
,top
does not behave in a way that works well with other programs. I will defer to what can be observed. Again, you may feel encouraged to post an alternative Answer if your familiarity withtop
's manual furnishes you with some insight into how to do what is required without switching fromtop
tops
.
– cryptarch
Jan 11 at 12:39
add a comment |
command:top -b -n1| sed -n '/PID/,$p'
output
ux_example ~]# top -b -n1| sed -n '/PID/,$p'
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7 root RT 0 0 0 0 S 1.7 0.0 0:01.04 migration/1
1 root 20 0 19356 1564 1252 S 0.0 0.1 0:07.96 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:03.46 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:01.84 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 1:58.23 watchdog/0
8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:02.87 ksoftirqd/1
10 root RT 0 0 0 0 S 0.0 0.0 2:10.65 watchdog/1
11 root RT 0 0 0 0 S 0.0 0.0 0:02.42 migration/2
12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/2
13 root 20 0 0 0 0 S 0.0 0.0 0:01.27 ksoftirqd/2
14 root RT 0 0 0 0 S 0.0 0.0 1:55.75 watchdog/2
15 root RT 0 0 0 0 S 0.0 0.0 0:01.03 migration/3
16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3
17 root 20 0 0 0 0 S 0.0 0.0 0:00.95 ksoftirqd/3
18 root RT 0 0 0 0 S 0.0 0.0 1:58.07 watchdog/3
19 root 20 0 0 0 0 S 0.0 0.0 0:14.40 events/0
20 root 20 0 0 0 0 S 0.0 0.0 3:52.96 events/1
21 root 20 0 0 0 0 S 0.0 0.0 0:16.77 events/2
22 root 20 0 0 0 0 S 0.0 0.0 1:34.48 events/3
23 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
24 root 20 0 0 0 0 S 0.0 0.0 0:00.01 khelper
25 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
26 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
28 root 20 0 0 0 0 S 0.0 0.0 0:07.44 sync_supers
29 root 20 0 0 0 0 S 0.0 0.0 0:03.43 bdi-default
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
31 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/1
32 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/2
33 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/3
34 root 20 0 0 0 0 S 0.0 0.0 0:02.02 kblockd/0
35 root 20 0 0 0 0 S 0.0 0.0 0:01.02 kblockd/1
36 root 20 0 0 0 0 S 0.0 0.0 0:07.83 kblockd/2
37 root 20 0 0 0 0 S 0.0 0.0 0:22.51 kblockd/3
38 root 20 0 0 0 0 S 0.0 0.0 0:
add a comment |
The various components of the Summary Area can be enabled or disabled as follows:
Summary-Area-defaults
'l' - Load Avg/Uptime On (thus program name)
't' - Task/Cpu states On (1+1 lines, see '1')
'm' - Mem/Swap usage On (2 lines worth)
'1' - Single Cpu On (thus 1 line if smp)
To disable all of them, start top
then press each of the m, l and t keys until those lines disappear (some of them cycle through a few modes, rather than being simple on-off toggles). Then save your changes to .toprc
with W.
After that, top -b -n 1
will show only a blank line, the column header line, and the individual lines for each process.
The configuration file is, for the most part, human-readable, so you could edit it directly, but it doesn't appear to be designed for that. (Notably, the fieldscur
field contains characters from outside the usual ASCII range.) The parts you want to disable are all represented by bits in the winflags
entry, but the exact values (as well as the location of the config file) may vary between different versions.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493852%2fhow-to-remove-the-summary-at-the-beginning-of-the-top-command-in-linux%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
The top
command is intended for interactive use. To get the output you want in a programmatic way, you might consider using ps
instead, which can give most of the same information but it is more script-friendly.
Example:
$ ps -eo pid,uid,pri,nice,vsz,rss,s,%cpu,%mem,time,comm | head
PID UID PRI NI VSZ RSS S %CPU %MEM TIME COMMAND
1 0 19 0 186380 9608 S 0.0 0.0 00:01:15 systemd
2 0 19 0 0 0 S 0.0 0.0 00:00:00 kthreadd
3 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_gp
4 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_par_gp
6 0 39 -20 0 0 I 0.0 0.0 00:00:00 kworker/0:0H-kblockd
8 0 39 -20 0 0 I 0.0 0.0 00:00:00 mm_percpu_wq
9 0 19 0 0 0 S 0.0 0.0 00:00:19 ksoftirqd/0
10 0 41 - 0 0 I 0.0 0.0 00:02:20 rcu_preempt
11 0 41 - 0 0 S 0.0 0.0 00:00:24 rcuc/0
Notice how the only field missing is SHR
. (I couldn't find out how to get ps
to print it.)
1
On the contrary, the manual for GNUtop
explicitly says that the-b
option is for sending output "to other programs".
– JdeBP
Jan 11 at 9:14
@JdeBP Okay, how well is that working for OP?
– cryptarch
Jan 11 at 10:30
@JdeBP I mean, if you think you have a better Answer ... where is it?
– cryptarch
Jan 11 at 10:33
You are constructing a false dilemma, when you could instead be fixing your answer. Your answer begins with an outright denial of what the manual for the command specifically says about the way that the questioner is using it. This is not an auspicious beginning to an answer.
– JdeBP
Jan 11 at 12:20
@JdeBP If you want to help me improve my answer, simply nitpicking over the manual is not the way to go. From what is posted in the question, it would appear that the manual contradicts observables. In the question we see that despite the use of-b
,top
does not behave in a way that works well with other programs. I will defer to what can be observed. Again, you may feel encouraged to post an alternative Answer if your familiarity withtop
's manual furnishes you with some insight into how to do what is required without switching fromtop
tops
.
– cryptarch
Jan 11 at 12:39
add a comment |
The top
command is intended for interactive use. To get the output you want in a programmatic way, you might consider using ps
instead, which can give most of the same information but it is more script-friendly.
Example:
$ ps -eo pid,uid,pri,nice,vsz,rss,s,%cpu,%mem,time,comm | head
PID UID PRI NI VSZ RSS S %CPU %MEM TIME COMMAND
1 0 19 0 186380 9608 S 0.0 0.0 00:01:15 systemd
2 0 19 0 0 0 S 0.0 0.0 00:00:00 kthreadd
3 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_gp
4 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_par_gp
6 0 39 -20 0 0 I 0.0 0.0 00:00:00 kworker/0:0H-kblockd
8 0 39 -20 0 0 I 0.0 0.0 00:00:00 mm_percpu_wq
9 0 19 0 0 0 S 0.0 0.0 00:00:19 ksoftirqd/0
10 0 41 - 0 0 I 0.0 0.0 00:02:20 rcu_preempt
11 0 41 - 0 0 S 0.0 0.0 00:00:24 rcuc/0
Notice how the only field missing is SHR
. (I couldn't find out how to get ps
to print it.)
1
On the contrary, the manual for GNUtop
explicitly says that the-b
option is for sending output "to other programs".
– JdeBP
Jan 11 at 9:14
@JdeBP Okay, how well is that working for OP?
– cryptarch
Jan 11 at 10:30
@JdeBP I mean, if you think you have a better Answer ... where is it?
– cryptarch
Jan 11 at 10:33
You are constructing a false dilemma, when you could instead be fixing your answer. Your answer begins with an outright denial of what the manual for the command specifically says about the way that the questioner is using it. This is not an auspicious beginning to an answer.
– JdeBP
Jan 11 at 12:20
@JdeBP If you want to help me improve my answer, simply nitpicking over the manual is not the way to go. From what is posted in the question, it would appear that the manual contradicts observables. In the question we see that despite the use of-b
,top
does not behave in a way that works well with other programs. I will defer to what can be observed. Again, you may feel encouraged to post an alternative Answer if your familiarity withtop
's manual furnishes you with some insight into how to do what is required without switching fromtop
tops
.
– cryptarch
Jan 11 at 12:39
add a comment |
The top
command is intended for interactive use. To get the output you want in a programmatic way, you might consider using ps
instead, which can give most of the same information but it is more script-friendly.
Example:
$ ps -eo pid,uid,pri,nice,vsz,rss,s,%cpu,%mem,time,comm | head
PID UID PRI NI VSZ RSS S %CPU %MEM TIME COMMAND
1 0 19 0 186380 9608 S 0.0 0.0 00:01:15 systemd
2 0 19 0 0 0 S 0.0 0.0 00:00:00 kthreadd
3 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_gp
4 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_par_gp
6 0 39 -20 0 0 I 0.0 0.0 00:00:00 kworker/0:0H-kblockd
8 0 39 -20 0 0 I 0.0 0.0 00:00:00 mm_percpu_wq
9 0 19 0 0 0 S 0.0 0.0 00:00:19 ksoftirqd/0
10 0 41 - 0 0 I 0.0 0.0 00:02:20 rcu_preempt
11 0 41 - 0 0 S 0.0 0.0 00:00:24 rcuc/0
Notice how the only field missing is SHR
. (I couldn't find out how to get ps
to print it.)
The top
command is intended for interactive use. To get the output you want in a programmatic way, you might consider using ps
instead, which can give most of the same information but it is more script-friendly.
Example:
$ ps -eo pid,uid,pri,nice,vsz,rss,s,%cpu,%mem,time,comm | head
PID UID PRI NI VSZ RSS S %CPU %MEM TIME COMMAND
1 0 19 0 186380 9608 S 0.0 0.0 00:01:15 systemd
2 0 19 0 0 0 S 0.0 0.0 00:00:00 kthreadd
3 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_gp
4 0 39 -20 0 0 I 0.0 0.0 00:00:00 rcu_par_gp
6 0 39 -20 0 0 I 0.0 0.0 00:00:00 kworker/0:0H-kblockd
8 0 39 -20 0 0 I 0.0 0.0 00:00:00 mm_percpu_wq
9 0 19 0 0 0 S 0.0 0.0 00:00:19 ksoftirqd/0
10 0 41 - 0 0 I 0.0 0.0 00:02:20 rcu_preempt
11 0 41 - 0 0 S 0.0 0.0 00:00:24 rcuc/0
Notice how the only field missing is SHR
. (I couldn't find out how to get ps
to print it.)
answered Jan 11 at 4:10
cryptarchcryptarch
78011
78011
1
On the contrary, the manual for GNUtop
explicitly says that the-b
option is for sending output "to other programs".
– JdeBP
Jan 11 at 9:14
@JdeBP Okay, how well is that working for OP?
– cryptarch
Jan 11 at 10:30
@JdeBP I mean, if you think you have a better Answer ... where is it?
– cryptarch
Jan 11 at 10:33
You are constructing a false dilemma, when you could instead be fixing your answer. Your answer begins with an outright denial of what the manual for the command specifically says about the way that the questioner is using it. This is not an auspicious beginning to an answer.
– JdeBP
Jan 11 at 12:20
@JdeBP If you want to help me improve my answer, simply nitpicking over the manual is not the way to go. From what is posted in the question, it would appear that the manual contradicts observables. In the question we see that despite the use of-b
,top
does not behave in a way that works well with other programs. I will defer to what can be observed. Again, you may feel encouraged to post an alternative Answer if your familiarity withtop
's manual furnishes you with some insight into how to do what is required without switching fromtop
tops
.
– cryptarch
Jan 11 at 12:39
add a comment |
1
On the contrary, the manual for GNUtop
explicitly says that the-b
option is for sending output "to other programs".
– JdeBP
Jan 11 at 9:14
@JdeBP Okay, how well is that working for OP?
– cryptarch
Jan 11 at 10:30
@JdeBP I mean, if you think you have a better Answer ... where is it?
– cryptarch
Jan 11 at 10:33
You are constructing a false dilemma, when you could instead be fixing your answer. Your answer begins with an outright denial of what the manual for the command specifically says about the way that the questioner is using it. This is not an auspicious beginning to an answer.
– JdeBP
Jan 11 at 12:20
@JdeBP If you want to help me improve my answer, simply nitpicking over the manual is not the way to go. From what is posted in the question, it would appear that the manual contradicts observables. In the question we see that despite the use of-b
,top
does not behave in a way that works well with other programs. I will defer to what can be observed. Again, you may feel encouraged to post an alternative Answer if your familiarity withtop
's manual furnishes you with some insight into how to do what is required without switching fromtop
tops
.
– cryptarch
Jan 11 at 12:39
1
1
On the contrary, the manual for GNU
top
explicitly says that the -b
option is for sending output "to other programs".– JdeBP
Jan 11 at 9:14
On the contrary, the manual for GNU
top
explicitly says that the -b
option is for sending output "to other programs".– JdeBP
Jan 11 at 9:14
@JdeBP Okay, how well is that working for OP?
– cryptarch
Jan 11 at 10:30
@JdeBP Okay, how well is that working for OP?
– cryptarch
Jan 11 at 10:30
@JdeBP I mean, if you think you have a better Answer ... where is it?
– cryptarch
Jan 11 at 10:33
@JdeBP I mean, if you think you have a better Answer ... where is it?
– cryptarch
Jan 11 at 10:33
You are constructing a false dilemma, when you could instead be fixing your answer. Your answer begins with an outright denial of what the manual for the command specifically says about the way that the questioner is using it. This is not an auspicious beginning to an answer.
– JdeBP
Jan 11 at 12:20
You are constructing a false dilemma, when you could instead be fixing your answer. Your answer begins with an outright denial of what the manual for the command specifically says about the way that the questioner is using it. This is not an auspicious beginning to an answer.
– JdeBP
Jan 11 at 12:20
@JdeBP If you want to help me improve my answer, simply nitpicking over the manual is not the way to go. From what is posted in the question, it would appear that the manual contradicts observables. In the question we see that despite the use of
-b
, top
does not behave in a way that works well with other programs. I will defer to what can be observed. Again, you may feel encouraged to post an alternative Answer if your familiarity with top
's manual furnishes you with some insight into how to do what is required without switching from top
to ps
.– cryptarch
Jan 11 at 12:39
@JdeBP If you want to help me improve my answer, simply nitpicking over the manual is not the way to go. From what is posted in the question, it would appear that the manual contradicts observables. In the question we see that despite the use of
-b
, top
does not behave in a way that works well with other programs. I will defer to what can be observed. Again, you may feel encouraged to post an alternative Answer if your familiarity with top
's manual furnishes you with some insight into how to do what is required without switching from top
to ps
.– cryptarch
Jan 11 at 12:39
add a comment |
command:top -b -n1| sed -n '/PID/,$p'
output
ux_example ~]# top -b -n1| sed -n '/PID/,$p'
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7 root RT 0 0 0 0 S 1.7 0.0 0:01.04 migration/1
1 root 20 0 19356 1564 1252 S 0.0 0.1 0:07.96 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:03.46 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:01.84 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 1:58.23 watchdog/0
8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:02.87 ksoftirqd/1
10 root RT 0 0 0 0 S 0.0 0.0 2:10.65 watchdog/1
11 root RT 0 0 0 0 S 0.0 0.0 0:02.42 migration/2
12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/2
13 root 20 0 0 0 0 S 0.0 0.0 0:01.27 ksoftirqd/2
14 root RT 0 0 0 0 S 0.0 0.0 1:55.75 watchdog/2
15 root RT 0 0 0 0 S 0.0 0.0 0:01.03 migration/3
16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3
17 root 20 0 0 0 0 S 0.0 0.0 0:00.95 ksoftirqd/3
18 root RT 0 0 0 0 S 0.0 0.0 1:58.07 watchdog/3
19 root 20 0 0 0 0 S 0.0 0.0 0:14.40 events/0
20 root 20 0 0 0 0 S 0.0 0.0 3:52.96 events/1
21 root 20 0 0 0 0 S 0.0 0.0 0:16.77 events/2
22 root 20 0 0 0 0 S 0.0 0.0 1:34.48 events/3
23 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
24 root 20 0 0 0 0 S 0.0 0.0 0:00.01 khelper
25 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
26 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
28 root 20 0 0 0 0 S 0.0 0.0 0:07.44 sync_supers
29 root 20 0 0 0 0 S 0.0 0.0 0:03.43 bdi-default
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
31 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/1
32 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/2
33 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/3
34 root 20 0 0 0 0 S 0.0 0.0 0:02.02 kblockd/0
35 root 20 0 0 0 0 S 0.0 0.0 0:01.02 kblockd/1
36 root 20 0 0 0 0 S 0.0 0.0 0:07.83 kblockd/2
37 root 20 0 0 0 0 S 0.0 0.0 0:22.51 kblockd/3
38 root 20 0 0 0 0 S 0.0 0.0 0:
add a comment |
command:top -b -n1| sed -n '/PID/,$p'
output
ux_example ~]# top -b -n1| sed -n '/PID/,$p'
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7 root RT 0 0 0 0 S 1.7 0.0 0:01.04 migration/1
1 root 20 0 19356 1564 1252 S 0.0 0.1 0:07.96 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:03.46 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:01.84 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 1:58.23 watchdog/0
8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:02.87 ksoftirqd/1
10 root RT 0 0 0 0 S 0.0 0.0 2:10.65 watchdog/1
11 root RT 0 0 0 0 S 0.0 0.0 0:02.42 migration/2
12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/2
13 root 20 0 0 0 0 S 0.0 0.0 0:01.27 ksoftirqd/2
14 root RT 0 0 0 0 S 0.0 0.0 1:55.75 watchdog/2
15 root RT 0 0 0 0 S 0.0 0.0 0:01.03 migration/3
16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3
17 root 20 0 0 0 0 S 0.0 0.0 0:00.95 ksoftirqd/3
18 root RT 0 0 0 0 S 0.0 0.0 1:58.07 watchdog/3
19 root 20 0 0 0 0 S 0.0 0.0 0:14.40 events/0
20 root 20 0 0 0 0 S 0.0 0.0 3:52.96 events/1
21 root 20 0 0 0 0 S 0.0 0.0 0:16.77 events/2
22 root 20 0 0 0 0 S 0.0 0.0 1:34.48 events/3
23 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
24 root 20 0 0 0 0 S 0.0 0.0 0:00.01 khelper
25 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
26 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
28 root 20 0 0 0 0 S 0.0 0.0 0:07.44 sync_supers
29 root 20 0 0 0 0 S 0.0 0.0 0:03.43 bdi-default
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
31 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/1
32 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/2
33 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/3
34 root 20 0 0 0 0 S 0.0 0.0 0:02.02 kblockd/0
35 root 20 0 0 0 0 S 0.0 0.0 0:01.02 kblockd/1
36 root 20 0 0 0 0 S 0.0 0.0 0:07.83 kblockd/2
37 root 20 0 0 0 0 S 0.0 0.0 0:22.51 kblockd/3
38 root 20 0 0 0 0 S 0.0 0.0 0:
add a comment |
command:top -b -n1| sed -n '/PID/,$p'
output
ux_example ~]# top -b -n1| sed -n '/PID/,$p'
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7 root RT 0 0 0 0 S 1.7 0.0 0:01.04 migration/1
1 root 20 0 19356 1564 1252 S 0.0 0.1 0:07.96 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:03.46 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:01.84 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 1:58.23 watchdog/0
8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:02.87 ksoftirqd/1
10 root RT 0 0 0 0 S 0.0 0.0 2:10.65 watchdog/1
11 root RT 0 0 0 0 S 0.0 0.0 0:02.42 migration/2
12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/2
13 root 20 0 0 0 0 S 0.0 0.0 0:01.27 ksoftirqd/2
14 root RT 0 0 0 0 S 0.0 0.0 1:55.75 watchdog/2
15 root RT 0 0 0 0 S 0.0 0.0 0:01.03 migration/3
16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3
17 root 20 0 0 0 0 S 0.0 0.0 0:00.95 ksoftirqd/3
18 root RT 0 0 0 0 S 0.0 0.0 1:58.07 watchdog/3
19 root 20 0 0 0 0 S 0.0 0.0 0:14.40 events/0
20 root 20 0 0 0 0 S 0.0 0.0 3:52.96 events/1
21 root 20 0 0 0 0 S 0.0 0.0 0:16.77 events/2
22 root 20 0 0 0 0 S 0.0 0.0 1:34.48 events/3
23 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
24 root 20 0 0 0 0 S 0.0 0.0 0:00.01 khelper
25 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
26 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
28 root 20 0 0 0 0 S 0.0 0.0 0:07.44 sync_supers
29 root 20 0 0 0 0 S 0.0 0.0 0:03.43 bdi-default
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
31 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/1
32 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/2
33 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/3
34 root 20 0 0 0 0 S 0.0 0.0 0:02.02 kblockd/0
35 root 20 0 0 0 0 S 0.0 0.0 0:01.02 kblockd/1
36 root 20 0 0 0 0 S 0.0 0.0 0:07.83 kblockd/2
37 root 20 0 0 0 0 S 0.0 0.0 0:22.51 kblockd/3
38 root 20 0 0 0 0 S 0.0 0.0 0:
command:top -b -n1| sed -n '/PID/,$p'
output
ux_example ~]# top -b -n1| sed -n '/PID/,$p'
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7 root RT 0 0 0 0 S 1.7 0.0 0:01.04 migration/1
1 root 20 0 19356 1564 1252 S 0.0 0.1 0:07.96 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:03.46 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:01.84 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 1:58.23 watchdog/0
8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1
9 root 20 0 0 0 0 S 0.0 0.0 0:02.87 ksoftirqd/1
10 root RT 0 0 0 0 S 0.0 0.0 2:10.65 watchdog/1
11 root RT 0 0 0 0 S 0.0 0.0 0:02.42 migration/2
12 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/2
13 root 20 0 0 0 0 S 0.0 0.0 0:01.27 ksoftirqd/2
14 root RT 0 0 0 0 S 0.0 0.0 1:55.75 watchdog/2
15 root RT 0 0 0 0 S 0.0 0.0 0:01.03 migration/3
16 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/3
17 root 20 0 0 0 0 S 0.0 0.0 0:00.95 ksoftirqd/3
18 root RT 0 0 0 0 S 0.0 0.0 1:58.07 watchdog/3
19 root 20 0 0 0 0 S 0.0 0.0 0:14.40 events/0
20 root 20 0 0 0 0 S 0.0 0.0 3:52.96 events/1
21 root 20 0 0 0 0 S 0.0 0.0 0:16.77 events/2
22 root 20 0 0 0 0 S 0.0 0.0 1:34.48 events/3
23 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
24 root 20 0 0 0 0 S 0.0 0.0 0:00.01 khelper
25 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
26 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
28 root 20 0 0 0 0 S 0.0 0.0 0:07.44 sync_supers
29 root 20 0 0 0 0 S 0.0 0.0 0:03.43 bdi-default
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/0
31 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/1
32 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/2
33 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kintegrityd/3
34 root 20 0 0 0 0 S 0.0 0.0 0:02.02 kblockd/0
35 root 20 0 0 0 0 S 0.0 0.0 0:01.02 kblockd/1
36 root 20 0 0 0 0 S 0.0 0.0 0:07.83 kblockd/2
37 root 20 0 0 0 0 S 0.0 0.0 0:22.51 kblockd/3
38 root 20 0 0 0 0 S 0.0 0.0 0:
answered Jan 11 at 18:32
Praveen Kumar BSPraveen Kumar BS
1,366138
1,366138
add a comment |
add a comment |
The various components of the Summary Area can be enabled or disabled as follows:
Summary-Area-defaults
'l' - Load Avg/Uptime On (thus program name)
't' - Task/Cpu states On (1+1 lines, see '1')
'm' - Mem/Swap usage On (2 lines worth)
'1' - Single Cpu On (thus 1 line if smp)
To disable all of them, start top
then press each of the m, l and t keys until those lines disappear (some of them cycle through a few modes, rather than being simple on-off toggles). Then save your changes to .toprc
with W.
After that, top -b -n 1
will show only a blank line, the column header line, and the individual lines for each process.
The configuration file is, for the most part, human-readable, so you could edit it directly, but it doesn't appear to be designed for that. (Notably, the fieldscur
field contains characters from outside the usual ASCII range.) The parts you want to disable are all represented by bits in the winflags
entry, but the exact values (as well as the location of the config file) may vary between different versions.
add a comment |
The various components of the Summary Area can be enabled or disabled as follows:
Summary-Area-defaults
'l' - Load Avg/Uptime On (thus program name)
't' - Task/Cpu states On (1+1 lines, see '1')
'm' - Mem/Swap usage On (2 lines worth)
'1' - Single Cpu On (thus 1 line if smp)
To disable all of them, start top
then press each of the m, l and t keys until those lines disappear (some of them cycle through a few modes, rather than being simple on-off toggles). Then save your changes to .toprc
with W.
After that, top -b -n 1
will show only a blank line, the column header line, and the individual lines for each process.
The configuration file is, for the most part, human-readable, so you could edit it directly, but it doesn't appear to be designed for that. (Notably, the fieldscur
field contains characters from outside the usual ASCII range.) The parts you want to disable are all represented by bits in the winflags
entry, but the exact values (as well as the location of the config file) may vary between different versions.
add a comment |
The various components of the Summary Area can be enabled or disabled as follows:
Summary-Area-defaults
'l' - Load Avg/Uptime On (thus program name)
't' - Task/Cpu states On (1+1 lines, see '1')
'm' - Mem/Swap usage On (2 lines worth)
'1' - Single Cpu On (thus 1 line if smp)
To disable all of them, start top
then press each of the m, l and t keys until those lines disappear (some of them cycle through a few modes, rather than being simple on-off toggles). Then save your changes to .toprc
with W.
After that, top -b -n 1
will show only a blank line, the column header line, and the individual lines for each process.
The configuration file is, for the most part, human-readable, so you could edit it directly, but it doesn't appear to be designed for that. (Notably, the fieldscur
field contains characters from outside the usual ASCII range.) The parts you want to disable are all represented by bits in the winflags
entry, but the exact values (as well as the location of the config file) may vary between different versions.
The various components of the Summary Area can be enabled or disabled as follows:
Summary-Area-defaults
'l' - Load Avg/Uptime On (thus program name)
't' - Task/Cpu states On (1+1 lines, see '1')
'm' - Mem/Swap usage On (2 lines worth)
'1' - Single Cpu On (thus 1 line if smp)
To disable all of them, start top
then press each of the m, l and t keys until those lines disappear (some of them cycle through a few modes, rather than being simple on-off toggles). Then save your changes to .toprc
with W.
After that, top -b -n 1
will show only a blank line, the column header line, and the individual lines for each process.
The configuration file is, for the most part, human-readable, so you could edit it directly, but it doesn't appear to be designed for that. (Notably, the fieldscur
field contains characters from outside the usual ASCII range.) The parts you want to disable are all represented by bits in the winflags
entry, but the exact values (as well as the location of the config file) may vary between different versions.
edited Jan 14 at 16:45
answered Jan 14 at 16:17
JigglyNagaJigglyNaga
3,873932
3,873932
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f493852%2fhow-to-remove-the-summary-at-the-beginning-of-the-top-command-in-linux%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown