How to remove the summary on beginner when top command was apply in LINUX
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 (wish mean the header are 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
Anyone can share me ideas?
linux awk sed top
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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 (wish mean the header are 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
Anyone can share me ideas?
linux awk sed top
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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 (wish mean the header are 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
Anyone can share me ideas?
linux awk sed top
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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 (wish mean the header are 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
Anyone can share me ideas?
linux awk sed top
linux awk sed top
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 1 min ago
Shi Jie TioShi Jie Tio
101
101
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Shi Jie Tio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
0
active
oldest
votes
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
});
}
});
Shi Jie Tio is a new contributor. Be nice, and check out our Code of Conduct.
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-on-beginner-when-top-command-was-apply-in-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Shi Jie Tio is a new contributor. Be nice, and check out our Code of Conduct.
Shi Jie Tio is a new contributor. Be nice, and check out our Code of Conduct.
Shi Jie Tio is a new contributor. Be nice, and check out our Code of Conduct.
Shi Jie Tio is a new contributor. Be nice, and check out our Code of Conduct.
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-on-beginner-when-top-command-was-apply-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