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

learn more… | top users | synonyms (1)

84
votes
13answers
31k views

How to have tail -f show colored output

I'd like to be able to tail the output of a server log file that has messages like: INFO SEVERE etc, and if it's SEVERE, show the line in red; if it's INFO, in green. What kind of alias can I ...
72
votes
8answers
72k 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-lin, because color makes the output more useful and intuitive. What are some good ...
60
votes
2answers
32k 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 ...
54
votes
3answers
14k views

Can less retain colored output?

Can I get less not to monochrome its output? E.g., the output from git diff is colored, but git diff | less is not.
35
votes
6answers
3k views

Can I configure my shell to print STDERR and STDOUT in different colors?

I want to set my terminal up so stderr is printed in a different color than stdout; maybe red. This would make it easier to tell the two apart. Is there a way to configure this in .bashrc? If not, is ...
33
votes
4answers
12k views

How to colorize output of git?

Is there a way to color output for git (or any command)? Consider: baller@Laptop:~/rails/spunky-monkey$ git status # On branch new-message-types # Changes not staged for commit: # (use "git add ...
29
votes
5answers
7k views

Program that passes STDIN to STDOUT with color codes stripped?

I have a command that produces output in color, and I would like to pipe it into a file with the color codes stripped out. Is there a command that works like cat except that it strips color codes? I ...
22
votes
3answers
4k views

Colors in Man Pages

When I look at a man page in my 'console' (not an xterm) I see some coloration, but I don't get this in my xterm's (e.g. konsole) is there any way I can enable this? hopefully a fairly simple ...
20
votes
4answers
6k views

How can you change the GNU screen status line based on hostname?

I have a shared home directory that is automounted via NFS on all the UNIX servers I log in to. I would like to have a single .screenrc that (for example) puts the hostname in the hardstatus line in a ...
19
votes
3answers
17k views

CLICOLOR and LS_COLORS in bash

I have the following setup in .bashrc for coloring of listings. export CLICOLOR=1 export ...
18
votes
6answers
6k views

How to check if bash can print colors

I want to know if there's any way to check if my program can output terminal output using colors or not. Running commands like less and looking at the output from a program that outputs using ...
18
votes
2answers
11k views

How to colorize output of ls ?

I'm running CentOS in Linux text mode. When I run the command ls /usr/, the output is too hard to read (dark blue on black). How can I change the text coloring?
17
votes
6answers
839 views

How can I highlight matches using GNU grep?

I have seen on some Linux, that grep is configured to highlight the match, and print the matching file. How can I configure grep to highlight matches?
17
votes
5answers
2k views

vim - better colors so comments aren't dark blue?

Mostly I edit ruby files, although shell script file comments are also # Currently my comments show as dark blue on black which is really hard to read. See screenshot. How can I change their color? ...
16
votes
4answers
8k views

Removing control chars (including console codes / colours) from script output

I can use the "script" command to record an interactive session at the command line. However, this includes all control characters and colour codes. I can remove control characters (like backspace) ...
13
votes
2answers
6k views

tmux bottom bar color change

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

Coloring different sources for tail

I'm watching different logs by tail -q -f /var/log/syslog -f /var/log/fail2ban.log -f /var/log/nginx/error.log How can I have the output of each log colored differently?
13
votes
2answers
11k views

How do I get the solarized colour scheme working with gnome-terminal, tmux and vim?

There's a lot of questions around this, but it's because there are so many variables. I had to piece together instructions from many sites before I got this working. First, I could not easily set up ...
12
votes
4answers
19k views

Why is Debian's root shell colorless?

Are there any security concerns? What is the best way to enable it?
12
votes
4answers
9k views

Dark blue color in vim or ls output in linux

I have a problem with dark-blue color in vim or ls output. Because I'm using black background color, words colored in dark-blue are almost completely invisible. How can I address this problem?
12
votes
1answer
2k views

git diff displays colors incorrectly

In order to get coloured output from all git commands, I set the following: git config --global color.ui true However, this produces an output like this for git diff, git log whereas commands ...
12
votes
2answers
2k views

Where do my ANSI escape codes go when I pipe to another process? Can I keep them?

I sometime want to pipe the color-coded output fror a process, eg. grep... but when I pipe it to another process, eg. sed, the color codes are lost... Is the some way to keep thes codes intact ? ...
12
votes
4answers
3k 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 ...
12
votes
1answer
12k views

Color schemes good for the eyes

Are there any common guidelines howto choose a color scheme (for example foreground/background color) for terminal, emacs etc. to minimize exhaustion of the eyes? If so, is there scientific evidence ...
12
votes
1answer
7k views

How to make Vim display colors as indicated by color codes?

In short, I'm in an effort to replace less with vim (vimpager). I have settings for scripts to spit out colors (and bold and everything nice) whenever they can. less understands the color codes and ...
12
votes
2answers
549 views

Can the empty spaces/background in a terminal be replaced with a random(but pretty) pattern of ASCII characters?

Context and Question There are many ways to colorize the terminal and shell environment. The output of individual commands, such as ls and grep, can also be colorized. Not directly related but ...
11
votes
1answer
20k views

Where to get Kate color schemes?

Does anyone know where one could find some good Kate color schemes for syntax highlighting? The only ones that I found that work fine are zenburn and mdark. Besides those two, I couldn't find ...
11
votes
1answer
4k views

How can I simply adjust monitor color temperture in X?

I have a new 27" iMac, on which I run Fedora 15 (with no Apple OS) — just boot straight to Linux. The colors are basically accurate to my eye, but the white point is much higher than I'd like (that ...
11
votes
3answers
7k views

How to get VIM to display 256 colors properly

I'm trying to get 256 color theme files to work with VIM under xterm. This is peaksea how it looks for me: How it should look: I've tried following the tips on the wiki page to no avail. set ...
10
votes
1answer
151 views

colorize bash_completion

When I type grep and then press TAB twice, bash_completion will list files and directories in current directory. It will also complete filenames when I type initial letter. That is all very nice, the ...
10
votes
1answer
1k views

Invert colors of the active window

Sometimes I work in low light and I need to invert the color of specific windows to reduce my eye strain. This could be my pdf viewer to web pages for reference work. I know how to invert the entire ...
9
votes
2answers
339 views

Filter output of command by color

I am running a utility that doesn't offer a way to filter its output. Nothing in the text of the output indicates that a particular function failed but it does show in red. The output is so long that ...
9
votes
2answers
1k views

Using sed to color the output from a command on solaris

I have a ksh script that must work on both linux and solaris. I'm trying to color the output of specific commands. It works on linux (specifically RHEL6), but not on solaris (SunOS 5.10). Command ...
9
votes
2answers
847 views

tmux, TERM and 256 colours support

Introduction My question arises from the necessity of understanding why I have now (after multiple trials) Terminal and tmux supporting 256 colours and tput colors telling me there are only 8 of ...
9
votes
1answer
601 views

Is there any env variable to turn --color (and the like) on for all commands?

I do use aliases to turn on color for some commands by default. But I'm wondering if there's an easier way at telling my system, color is supported, don't make me use --color for grep, ls, etc.
9
votes
1answer
944 views

How to have tail -f show colored output with vim?

In this question, Gilles answered Yet another possibility is to run tail -f in an Emacs shell buffer and use Emacs's syntax coloring abilities. Because I'm a vim user, I'd like to do this with ...
8
votes
3answers
5k views

dircolors: modify color settings globaly

I understand ls uses dircolors to display colored output. dircolors has default database of colors associated with file extensions, which can be printed wiht the command dircolors --print-database ...
8
votes
3answers
2k views

Mark occurrences of keyword with a different color

I have a program which spits out an output to stdout like: [OK] Something is ok [OK] Something else is also ok [FAIL] This does not look good [FAIL] Neither does this [OK] At ...
8
votes
2answers
3k views

256 colour prompt in Zsh

How can I set my prompt to be colourized in 256 colours? I am looking for an equivalent to the bash prompt: local DEFAULT="\[\033[0;39m\]" local ROOK="\[\033[38;5;24m\]" ...
8
votes
5answers
2k views

`highlight` command

Is there a command which can be used to easily highlight (with colors, bold text or inverted back-/foreground) specific strings in stdin while passing the entire string to stdout? I'm thinking of ...
8
votes
2answers
2k views

Testing LS_COLORS in zsh

A few years ago I found an interesting code snippet that prints each type of file in its corresponding color according to the colors set up in LS_COLORS. Unfortunately, I can't remember the link ...
8
votes
1answer
1k views

How can I change screen's hardstatus color based on the logged in user?

I haven't edited/created a .screenrc file in a while, but this is what I'm currently using: # Turn off the screen startup message startup_message off # Define format of bottom ...
7
votes
3answers
405 views

How to permanently change both STDOUT and STDERR color to grey?

This question is similar to Can I configure my shell to print STDERR and STDOUT in different colors? But I am looking for a solution that will allow me to change both STDOUT and STDERR to ONE color. ...
7
votes
2answers
4k views

What causes this green background in ls output?

There are two directories shown by 'ls'. Normally directories anywhere are blue on black background. But the first one is blue on green and impossible to read. Why is this? How to make it blue ...
7
votes
2answers
3k 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 ...
7
votes
3answers
929 views

Change the color of the file name text

I am writing scripts to initialize and configure a large system with many components. Each component has its own log file. I would like to change the color of the component file name to red whenever ...
7
votes
3answers
1k views

Change the PS1 color based on the background color?

I learned that I can change the format of PS1, especially the color of the string. Then, is it possible to change the color based on the background color of the shell? Or, how can I detect the ...
7
votes
2answers
211 views

Using empty line as context “group-separator” for grep

I need grep output with context, in color, and blank lines as group separator. In this question, I learned how to define custom group-separator, and I have constructed my grep command like this: grep ...
7
votes
3answers
3k views

Disable colours on terminal and SSH

My local Linux machine has coloured terminal output like this; When I SSH to a pfSense/BSD box it changes the colours like this; Even when I SSH from to a machine that doesn't have a coloured ...
7
votes
1answer
1k views

Get colors in less command with ccze: Shift + g doesn't go to the end of file?

In all the tools to get colors with less command: -R, Pygments, GNU Source-highlight, vless, ... ccze make me sastified with below command: ccze -A < /path/to/log/file | less -R but Shift+g ...