how to disable color in output of 'top' command?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm trying to process 'top' output to set CPU performance data. When I just grep the output it is colorized:
or
The numbers are bold, and it adds a lot of unnecessary data to the output:
I tried to strip the color codes answer but it does not work. I want to avoid other much more complex answers in that question for sake of performance.
I've tried to disable colors by switching term mode but no luck:
So how can I disable the color output?
PS: I found how to get data: I can awk only numbers then it works, but still wonder if there is any way to disable color here.
terminal colors top
 |Â
show 3 more comments
up vote
1
down vote
favorite
I'm trying to process 'top' output to set CPU performance data. When I just grep the output it is colorized:
or
The numbers are bold, and it adds a lot of unnecessary data to the output:
I tried to strip the color codes answer but it does not work. I want to avoid other much more complex answers in that question for sake of performance.
I've tried to disable colors by switching term mode but no luck:
So how can I disable the color output?
PS: I found how to get data: I can awk only numbers then it works, but still wonder if there is any way to disable color here.
terminal colors top
6
Have you looked intotop -b
?
â DopeGhoti
Dec 5 '17 at 22:49
Parsingtop
output is not really a good idea for monitoring.
â Patrick Mevzek
Dec 6 '17 at 2:10
@PatrickMevzek please provide better alternative.
â Putnik
Dec 6 '17 at 21:31
@DopeGhoti perfect! Thank you
â Putnik
Dec 6 '17 at 21:33
It depends on what numbers do you want (it do not know what "performance data" is) and what you do with them.top
is only a frontend using values in collected from various files in/proc/
and/sys/
. For example see/proc/meminfo
,/proc/loadavg
or/proc/stat
. There are libraries and tools using and parsing that.
â Patrick Mevzek
Dec 6 '17 at 21:34
 |Â
show 3 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to process 'top' output to set CPU performance data. When I just grep the output it is colorized:
or
The numbers are bold, and it adds a lot of unnecessary data to the output:
I tried to strip the color codes answer but it does not work. I want to avoid other much more complex answers in that question for sake of performance.
I've tried to disable colors by switching term mode but no luck:
So how can I disable the color output?
PS: I found how to get data: I can awk only numbers then it works, but still wonder if there is any way to disable color here.
terminal colors top
I'm trying to process 'top' output to set CPU performance data. When I just grep the output it is colorized:
or
The numbers are bold, and it adds a lot of unnecessary data to the output:
I tried to strip the color codes answer but it does not work. I want to avoid other much more complex answers in that question for sake of performance.
I've tried to disable colors by switching term mode but no luck:
So how can I disable the color output?
PS: I found how to get data: I can awk only numbers then it works, but still wonder if there is any way to disable color here.
terminal colors top
edited Dec 5 '17 at 23:01
Jeff Schaller
32k848109
32k848109
asked Dec 5 '17 at 22:44
Putnik
4142514
4142514
6
Have you looked intotop -b
?
â DopeGhoti
Dec 5 '17 at 22:49
Parsingtop
output is not really a good idea for monitoring.
â Patrick Mevzek
Dec 6 '17 at 2:10
@PatrickMevzek please provide better alternative.
â Putnik
Dec 6 '17 at 21:31
@DopeGhoti perfect! Thank you
â Putnik
Dec 6 '17 at 21:33
It depends on what numbers do you want (it do not know what "performance data" is) and what you do with them.top
is only a frontend using values in collected from various files in/proc/
and/sys/
. For example see/proc/meminfo
,/proc/loadavg
or/proc/stat
. There are libraries and tools using and parsing that.
â Patrick Mevzek
Dec 6 '17 at 21:34
 |Â
show 3 more comments
6
Have you looked intotop -b
?
â DopeGhoti
Dec 5 '17 at 22:49
Parsingtop
output is not really a good idea for monitoring.
â Patrick Mevzek
Dec 6 '17 at 2:10
@PatrickMevzek please provide better alternative.
â Putnik
Dec 6 '17 at 21:31
@DopeGhoti perfect! Thank you
â Putnik
Dec 6 '17 at 21:33
It depends on what numbers do you want (it do not know what "performance data" is) and what you do with them.top
is only a frontend using values in collected from various files in/proc/
and/sys/
. For example see/proc/meminfo
,/proc/loadavg
or/proc/stat
. There are libraries and tools using and parsing that.
â Patrick Mevzek
Dec 6 '17 at 21:34
6
6
Have you looked into
top -b
?â DopeGhoti
Dec 5 '17 at 22:49
Have you looked into
top -b
?â DopeGhoti
Dec 5 '17 at 22:49
Parsing
top
output is not really a good idea for monitoring.â Patrick Mevzek
Dec 6 '17 at 2:10
Parsing
top
output is not really a good idea for monitoring.â Patrick Mevzek
Dec 6 '17 at 2:10
@PatrickMevzek please provide better alternative.
â Putnik
Dec 6 '17 at 21:31
@PatrickMevzek please provide better alternative.
â Putnik
Dec 6 '17 at 21:31
@DopeGhoti perfect! Thank you
â Putnik
Dec 6 '17 at 21:33
@DopeGhoti perfect! Thank you
â Putnik
Dec 6 '17 at 21:33
It depends on what numbers do you want (it do not know what "performance data" is) and what you do with them.
top
is only a frontend using values in collected from various files in /proc/
and /sys/
. For example see /proc/meminfo
, /proc/loadavg
or /proc/stat
. There are libraries and tools using and parsing that.â Patrick Mevzek
Dec 6 '17 at 21:34
It depends on what numbers do you want (it do not know what "performance data" is) and what you do with them.
top
is only a frontend using values in collected from various files in /proc/
and /sys/
. For example see /proc/meminfo
, /proc/loadavg
or /proc/stat
. There are libraries and tools using and parsing that.â Patrick Mevzek
Dec 6 '17 at 21:34
 |Â
show 3 more comments
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Here's one way to disable colored output in top
:
Step 1: Run top
Step 2: Press the z
key to toggle the color mode
Step 3: Press the W
key to save the new setting
For reference, look at the top man page, specifically Section 4: Interactive Commands. There you will find the following descriptions of these two interactive commands:
W :Write-the-Configuration-File
This will save all of your options and toggles plus the
current display mode and delay time. By issuing this command
just before quitting top, you will be able restart later in
exactly that same state.
z :Color/Monochrome toggle
Switches the `current' window between your last used color
scheme and the older form of black-on-white or white-on-black.
This command will alter both the summary area and task area
but does not affect the state of the `x', `y' or `b' toggles.
Also see these related posts:
Set default color for top
Setting the TOPCOLORS environment variable
'Setting the TOPCOLORS' is the exact answer because 'z' turns it even more colorful. Thanks!
â Putnik
Dec 6 '17 at 21:41
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Here's one way to disable colored output in top
:
Step 1: Run top
Step 2: Press the z
key to toggle the color mode
Step 3: Press the W
key to save the new setting
For reference, look at the top man page, specifically Section 4: Interactive Commands. There you will find the following descriptions of these two interactive commands:
W :Write-the-Configuration-File
This will save all of your options and toggles plus the
current display mode and delay time. By issuing this command
just before quitting top, you will be able restart later in
exactly that same state.
z :Color/Monochrome toggle
Switches the `current' window between your last used color
scheme and the older form of black-on-white or white-on-black.
This command will alter both the summary area and task area
but does not affect the state of the `x', `y' or `b' toggles.
Also see these related posts:
Set default color for top
Setting the TOPCOLORS environment variable
'Setting the TOPCOLORS' is the exact answer because 'z' turns it even more colorful. Thanks!
â Putnik
Dec 6 '17 at 21:41
add a comment |Â
up vote
2
down vote
accepted
Here's one way to disable colored output in top
:
Step 1: Run top
Step 2: Press the z
key to toggle the color mode
Step 3: Press the W
key to save the new setting
For reference, look at the top man page, specifically Section 4: Interactive Commands. There you will find the following descriptions of these two interactive commands:
W :Write-the-Configuration-File
This will save all of your options and toggles plus the
current display mode and delay time. By issuing this command
just before quitting top, you will be able restart later in
exactly that same state.
z :Color/Monochrome toggle
Switches the `current' window between your last used color
scheme and the older form of black-on-white or white-on-black.
This command will alter both the summary area and task area
but does not affect the state of the `x', `y' or `b' toggles.
Also see these related posts:
Set default color for top
Setting the TOPCOLORS environment variable
'Setting the TOPCOLORS' is the exact answer because 'z' turns it even more colorful. Thanks!
â Putnik
Dec 6 '17 at 21:41
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Here's one way to disable colored output in top
:
Step 1: Run top
Step 2: Press the z
key to toggle the color mode
Step 3: Press the W
key to save the new setting
For reference, look at the top man page, specifically Section 4: Interactive Commands. There you will find the following descriptions of these two interactive commands:
W :Write-the-Configuration-File
This will save all of your options and toggles plus the
current display mode and delay time. By issuing this command
just before quitting top, you will be able restart later in
exactly that same state.
z :Color/Monochrome toggle
Switches the `current' window between your last used color
scheme and the older form of black-on-white or white-on-black.
This command will alter both the summary area and task area
but does not affect the state of the `x', `y' or `b' toggles.
Also see these related posts:
Set default color for top
Setting the TOPCOLORS environment variable
Here's one way to disable colored output in top
:
Step 1: Run top
Step 2: Press the z
key to toggle the color mode
Step 3: Press the W
key to save the new setting
For reference, look at the top man page, specifically Section 4: Interactive Commands. There you will find the following descriptions of these two interactive commands:
W :Write-the-Configuration-File
This will save all of your options and toggles plus the
current display mode and delay time. By issuing this command
just before quitting top, you will be able restart later in
exactly that same state.
z :Color/Monochrome toggle
Switches the `current' window between your last used color
scheme and the older form of black-on-white or white-on-black.
This command will alter both the summary area and task area
but does not affect the state of the `x', `y' or `b' toggles.
Also see these related posts:
Set default color for top
Setting the TOPCOLORS environment variable
edited Dec 6 '17 at 0:06
answered Dec 5 '17 at 23:51
igal
4,830930
4,830930
'Setting the TOPCOLORS' is the exact answer because 'z' turns it even more colorful. Thanks!
â Putnik
Dec 6 '17 at 21:41
add a comment |Â
'Setting the TOPCOLORS' is the exact answer because 'z' turns it even more colorful. Thanks!
â Putnik
Dec 6 '17 at 21:41
'Setting the TOPCOLORS' is the exact answer because 'z' turns it even more colorful. Thanks!
â Putnik
Dec 6 '17 at 21:41
'Setting the TOPCOLORS' is the exact answer because 'z' turns it even more colorful. Thanks!
â Putnik
Dec 6 '17 at 21:41
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409053%2fhow-to-disable-color-in-output-of-top-command%23new-answer', 'question_page');
);
Post as a guest
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
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
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
6
Have you looked into
top -b
?â DopeGhoti
Dec 5 '17 at 22:49
Parsing
top
output is not really a good idea for monitoring.â Patrick Mevzek
Dec 6 '17 at 2:10
@PatrickMevzek please provide better alternative.
â Putnik
Dec 6 '17 at 21:31
@DopeGhoti perfect! Thank you
â Putnik
Dec 6 '17 at 21:33
It depends on what numbers do you want (it do not know what "performance data" is) and what you do with them.
top
is only a frontend using values in collected from various files in/proc/
and/sys/
. For example see/proc/meminfo
,/proc/loadavg
or/proc/stat
. There are libraries and tools using and parsing that.â Patrick Mevzek
Dec 6 '17 at 21:34