It is possible to use colors on the Unix command-line interface.

learn more… | top users | synonyms (1)

37
votes
4answers
28k views

What color codes can I use in my PS1 prompt?

I used several colors in my PS1 prompt such as \033]01;31\] # pink \033]00m\] # white \033]01;36\] # bold green \033]02;36\] # green \033]01;34\] # blue \033]01;33\] # bold yellow Where can I ...
3
votes
4answers
116 views

Where should I save color codes for the PS1 command line / terminal? [on hold]

This question is about best practices. I know logging in over secure shell or switching users su, and su -l have different effects. Also, in the event you make a typo in the configuration, you still ...
1
vote
1answer
953 views

Terminal colors putty raspbian

I'm connecting to my Raspberry Pi from my Windows Machine using putty. I already adjusted the colors for bold blue in putty to be more readable (using this guide). But I still have problems with the ...
6
votes
1answer
1k views

Program similar to xcalib to invert desktop colors

I'm using xcalib to invert colors on my computer at home. I have two monitors at work, and unfortunately the xcalib -i -a inverts only one of them (the one I don't want to invert). I haven't found any ...
1
vote
0answers
36 views

Portable color codes with printf? [duplicate]

There is a color codes script on GitHub suitable for sourcing, which I am modifying for my own purposes. Background I have an odd mix of environments to work in, from a Mac OS terminal, to various ...
14
votes
2answers
788 views

Colored output?

When I execute a command from a terminal that prints coloured output (such as ls or gcc), the coloured output is printed. From my understanding, the process is actually outputting ANSI escape codes, ...
0
votes
1answer
28 views

how to color specific strings in standard output and standard error [duplicate]

How do you color specific strings in standard output and standard error? For example: gpg --verify Outputs either a good signature or a bad signature string. How can I color the good one, green; ...
2
votes
1answer
29 views

In the SGR number 38 and 48, where do the 2 and 5 numbers come from?

In multi-color-compatible terminals, one can set a color from a 256-color palette by using ESC[38;5;Nm, and any RGB color using ESC[38;2;R;G;Bm. I've been wondering though, where do the "2" and "5" ...
3
votes
2answers
481 views

Defining color codes in rxvt-unicode

Using some of node.js tools like mocha in my urxvt terminal, I have some problems with coloured output. Some of the text that are using colour code 90 as you can see here will be disappeared in ...
1
vote
3answers
38 views

Unable to use a escape sequences in a variable in a sed command

I'm using sed to highlight a column in the output of a ps command, and it works fine if I hard code the color code. However, the color needs to be dynamic, so I tried moving it to a variable, and ...
2
votes
1answer
39 views

Highlight nth column of ps output

I'm trying to find the best way to highlight a specific column of some output. Specifically, I'm trying to highlight the 9th column (which is %cpu of the command: ps -eo ...
-1
votes
1answer
24 views

tmux not printing ANSI colors in status bar

I'm using Mac OSX Yosemite, and I use istats to get CPU temperatures: I wanted to put my CPU temperature in my tmux status bar, so I made my tmux config the following: As you can see, when I ran ...
9
votes
3answers
4k views

How to colorize text in emacs?

I want to view (and/or edit) colorized text in emacs, such as is output by ls -l --color=always, tree..., or whatever. The text I refer to exists in a file. When I open that file in emacs, I want to ...
0
votes
1answer
11 views

Display RGB database foreground/background combinations

I'm trying to adjust color in X. I seem to recall that there are a couple of utilities available to experiment with foreground/background combination while displaying all the colors. Anybody know ...
1
vote
2answers
38 views

Diff patch output saved to a file. How to see it syntax-colored?

I have a folder with subfolders that contains text files. Every now and then I run a script that makes a copy of that folder tree and then creates a new one with fresh info. After that, having the ...
1
vote
0answers
27 views

Paging with follow less +F and colorize with awk

I would like to paginate a file with follow, i.e. $less +F and also colorize the output on the screen. I want to use less because I can leave the follow mode, browse the file and then re-enter the ...
0
votes
0answers
19 views

grep, assigning colour per string match? [duplicate]

Is it possible to set the colour of a Grep result per search. I have searched and cannot find a definitive answer Am scanning through some large Error Logs and ideally looking for the output of ...
32
votes
2answers
24k views

tmux bottom bar color change

I recently started to use tmux and like it much, but its green bottom bar is a bit distracting, is there a way to change its color? or a way to hide it?
99
votes
2answers
69k views

Getting 256 colors to work in tmux

I have 256 colors working just fine in konsole,. I thought I'd give tmux a try because, unlike screen, it seems to support vi mode. However I find that the colors of my prompt show up and this is ...
11
votes
2answers
3k views

is there a way to set coloring for cd tab complete?

I use ubuntu 11.04. Is there a way to set coloring for output after tab completion listing of a cd, ls, or etc. ? i.e. myshell@root$ cd ~/user/files/ I hit tab... myfile myfoo mybar <-- this ...
1
vote
1answer
4k views

Terminal colors for Vim Airline and Tmux Tmuxline

When using Vim on its own with Vundle and Airline the theme appears normally: When I have loaded it up in Tmuxline, the theme uses different colors and even Vim looks different: Here's my Tmux ...
1
vote
1answer
49 views

Terminal color usage does not stay

I was wondering if any of you knew why doesn't my terminal keep displaying stuff colored, after I use the command ls -l -a --color=always I would like it to stay colored, so when the next time I type ...
0
votes
0answers
28 views

Different vim colors and styles in Tmux and Gnome

I am using tmux, and recently found out that the same vim colorshemes inside and outside of tmux have different colors Left is tmux in gnome-terminal, right is plain gnome-terminal, gnome-terminal ...
1
vote
2answers
35 views

How to color some strings in a file

I prepare a file Hello.txt as follows. 1253125213 213532135 23513125215 Then, I want to color each line blue except "2", and color the "2" red. At first, I wrote BLUE='\033[0;34m' ...
0
votes
0answers
18 views

Possibility to write some words in different color in log file [duplicate]

Is there a possibility to colorize words in a log file? I want to have the word ERROR in my logfile always in red, to see it more easily. I watch it with the tail function: tail -f -n 500 ...
5
votes
2answers
849 views

Set tmux status line color based on hostname

I'd like tmux to pick a color dynamically based on the hostname of the machine. Since I share my tmux.conf across several machines, assigning an unique color for each of those hosts would be handy ...
1
vote
0answers
27 views

Do light color codes work across all distros and terminals? [duplicate]

I use \033[1;34m for light blue. I am using Debian and Putty and it works for me. However, I've heard that it may not work for all users (using different distros and terminals). Is that true? Do they ...
9
votes
3answers
627 views

Piping a command through a color filter

Does something like this exist in Unix? $ echo "this should show in red" | red $ echo "this should show in green" | green $ echo "this should show in blue" | blue Here I don't mean for literal ...
15
votes
2answers
561 views

How do I use grep while keeping the original text color? [duplicate]

For example, I have a output: Hello, this is the output. (let's say that for example hello is colored red, and the is colored green, and output is colored purple). Now, let's say that this is the ...
0
votes
2answers
39 views

How do I create a dark blue text on a bright white background in MOTD in Debian?

This is what I currently have. It displays black on bright white. However, I want to have blue (0;34m) on bright white. ^[[0;7;34;37;5mWelcome!^[[0m I used this website as a reference, but I did ...
0
votes
2answers
41 views

How do I make the terminal background bright white?

I am using: setterm --foreground blue --background white --blink on The result is that the text is blue on bright white. However, the background around the text is grey. How can I make the entire ...
2
votes
1answer
23 views

make ls gray out files that end with tilde (`~`) using `LS_COLOR`

Problem: I am trying to modify LS_COLORS to gray out all files ending with the tilde character. Question: Can anybody spot my mistake? Here is what I did: # write dircolors file: dircolors -p > ...
1
vote
1answer
24 views

set color of conky

I want to set the color of a line to a specific shade of yellow (but not just yellow). I set it like this: ${font LCDMono:bold:size=20}${color yellow}Uptime:$color $uptime Where all the line has ...
0
votes
0answers
16 views

colours specified in terminal emulator? [duplicate]

In terminal editors one can specify a set of colors - a theme - which should be used. In konsole and x-terminal-editor one can set up 16 colors, they seem not to be named, rather only numbered. ...
3
votes
1answer
54 views

Filtering the colored output of grep

I'm on OSX, but I suspect this doesn't make a big difference for this question. In my .bash_profile, I aliased grep to get color outputs by default: alias grep='grep --color=always' I commonly run ...
5
votes
5answers
5k views

How do you colorize only some keywords for a bash script?

I am running some unit test code. The unit test code outputs regular text. There is a lot of the text so I want to highlight for the user important keywords. In this case the keywords are "PASS" and ...
2
votes
1answer
24 views

Change color when changing directory

I have two folders called Documents and Downloads. In zsh, when I type cdSpaceDoTabc the color of Documents change from white to (hard to read) gray. How can I turn off this color change or control ...
130
votes
15answers
218k views

Colorizing your terminal and shell environment?

I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command line, because color makes the output more useful and intuitive. What options exist ...
27
votes
7answers
11k views

Converting colored output into html

There are tools providing coloured output: dwdiff -c File1 File2 # word level diff grep --color=always # we all know this guy ... The question is: How to convert their colored output of arbitrary ...
1
vote
1answer
74 views

Why xfce4 terminal colors are so ugly? [closed]

Hello I have a big problem, I'm trying to install some nice color themes on fish and vim but it looks like that my xfce4-terminal has some ill looking internal colors. I installed gnome-terminal to ...
4
votes
1answer
46 views

Use same colors in bash tab complete and ls [duplicate]

Bash is using a different color for tab completion than ls. For example, my ls command uses a red color for a broken symlinks (I'm using dircolors to configure it), but if I use ls Tab, the color is ...
0
votes
0answers
40 views

Vim not loading color scheme file at all

I have exactly same two CentOS 6 boxes. Trying to install vim and enable color scheme file. Same thing, same vim versions used but the color scheme works in one machine and not in other. Here are ...
3
votes
1answer
64 views

Change dir colour in bash output

Under Mac OSX, I am trying to change the dir colour when ls outputs in the bash shell. So I placed this line at the end of my .bashrc file and reloaded. LS_COLORS=$LS_COLORS:'di=0;32:' ; export ...
3
votes
1answer
126 views

Does “color” in TERM always mean I can use colors?

Should the following always indicate that I can use escape sequences and tput to colorize things? if [[ $TERM == *"color"* ]]; then true else false fi
2
votes
1answer
57 views

How to substitute one color code for another in terminal?

Can I make bash automatically substitute one color code for another? For example, whenever a program outputs text wrapped in color code for bold foreground, I would like bash to actually use code for ...
6
votes
1answer
2k views

How can I keep color codes with grep input?

If I use two consecutive grep commands, e.g.: echo "foo bar" | grep foo | grep bar Then the first pattern ("foo") is not highlighted. In fact, it seems that grep removes color codes from its input. ...
0
votes
1answer
22 views

xterm highlighting always white, not reverse

I'm running Debian on my desktop, laptop, and netbook. On my desktop and laptop, I am using Gnome desktop environment; whereas my netbook is using i3wm (installed after a text-only install initially). ...
1
vote
0answers
55 views

Terminal colors changing when opening a new tab

I'm running Ubuntu 14.04 (x64 desktop edition) and I have an issue in my terminal (bash) where my colors seem to get "saturated" and my line cursor changes to black when opening a new tab, the first ...
3
votes
3answers
367 views

tput setaf color table? How to determine color codes?

I am in the process of colorizing my terminal’s PS1. I am setting color variables using tput; for example, here’s purple: PURPLE=$(tput setaf 125) Question: How do I find the color codes (e.g. ...
35
votes
5answers
2k views

Syntax highlighting in the terminal

Lots of programming-oriented editors will colorize source code. Is there a command that will colorize source code for viewing in the terminal? I could open a file with emacs -nw (which opens in the ...