It is possible to use colors on the Unix command-line interface.
62
votes
12answers
13k 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 ...
41
votes
8answers
28k 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 are some good ...
30
votes
2answers
15k 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 ...
24
votes
6answers
2k views
Is it possible to configure Bash so that STDERR can be a different color than STDOUT?
I'd like to set up my terminal to have STDOUT print regularly, but have STDERR print out in a different color, namely red, so I can tell the difference between the two, ie:
STDOUT: HELLO WORLD
...
24
votes
3answers
5k 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.
20
votes
4answers
3k 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 ...
18
votes
3answers
4k 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 ...
16
votes
4answers
3k 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 ...
15
votes
7answers
609 views
Pimp my GNU grep
I have seen on some Linux, grep is configured to highlight the match, and print the matching file.
How do you configure GNU grep best?
13
votes
6answers
4k 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 ...
11
votes
3answers
3k 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) ...
11
votes
4answers
2k 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 ...
11
votes
2answers
10k views
CLICOLOR and LS_COLORS in bash
I have the following setup in .bashrc for coloring of listings.
export CLICOLOR=1
export ...
10
votes
2answers
7k 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?
9
votes
3answers
3k 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 ...
8
votes
3answers
913 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 ...
8
votes
1answer
467 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.
8
votes
1answer
4k 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 ...
8
votes
2answers
621 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 ...
7
votes
3answers
4k 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?
7
votes
3answers
511 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
1answer
2k 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\]"
...
7
votes
2answers
1k 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 ...
7
votes
1answer
679 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 ...
7
votes
3answers
399 views
Can I highlight the current prompt line in zsh?
Is it possible to highlight (set a background colour) for the whole line of the prompt in zsh? In my emacs config I have the line on which the cursor sits a slightly different colour to the window ...
6
votes
3answers
248 views
Are unix[-like] programs capable of determing where their output is going?
Up until recently I was under the impression that Unix-y programs were unaware of where their output went, be it to standard out, redirected to a file, or into a pipe. However, an unrelated U&L ...
6
votes
2answers
1k 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 ?
...
6
votes
1answer
798 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?
6
votes
3answers
6k views
Why is Debian's root shell colorless?
Are there any security concerns? What is the best way to enable it?
6
votes
2answers
683 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 ...
6
votes
2answers
1k views
16 Colors in ZShell
I only seem to be able to call 8 colors in my zshell prompt.
Example:
PROMPT="[%n@%{$fg[magenta]%}%m%{$reset_color%} %.]
%# "
Works fine. However,
...
6
votes
4answers
1k 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 ...
6
votes
1answer
582 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 ...
6
votes
1answer
4k 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 ...
6
votes
4answers
476 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 ...
6
votes
1answer
377 views
Using dircolors, how do I change the color of my subversion folders
Below is a sample of my dircolors file, I want subversion folders (.svn) to be colored, but i guess the extension section only applies to file names.
How do i set colors for directories with ...
6
votes
1answer
1k views
Nested ssh session inside screen has no color
I am attempting to keep a nested ssh session inside of a byobu/screen window, which I also connect to over SSH with Putty on Windows.
However the nested SSH session has no color. Here's what I'm ...
6
votes
1answer
2k 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 ...
6
votes
1answer
450 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 ...
5
votes
4answers
685 views
How to create a testcolor.sh like the following screenshot?
I found this image on the internet, but don't know how was it made,
Can anyone provide a sample on that? I just would like to have a color table as well.
5
votes
6answers
321 views
Colourful terminal or console?
I love colors in my console, and I wonder if there is any way to get a terminal (I guess only a software is able to do that) printing almost everything in colors.
Of course there is the --color=auto ...
5
votes
2answers
582 views
red-green color blindness compatible vim theme
I am looking for a vim theme accessible to users with red green color blindness. In particular, the red text on a dark terminal background all but disappears. Do any of you know of a good theme? Or ...
5
votes
4answers
345 views
ls colors for permissions
Is there a way to control the color output of ls to highlight specific permissions on files? (e.g. write permissions).
Any options in LS_COLORS that would do this? (the image above is from Dired+ ...
5
votes
3answers
451 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 ...
5
votes
3answers
974 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 ...
5
votes
1answer
717 views
Is it possible to use named colors in Zsh beyond ANSI names?
I know there are ways to use ANSI color names in Zsh (such as red), but Zsh supports 256 colors by number. I'm curious if there's any way to refer to the non-ANSI colors by a name? (Without just ...
5
votes
1answer
181 views
What are the origins of rgb.txt?
Where did the list of X11 color names come from? Every resource I've found online claims the origin is unknown, but it must be recorded somewhere. The best information I've found was in an archived ...
5
votes
2answers
288 views
emacs colors based on $TERM environment variable
I want to know if it is possible to make emacs, when running in a gnu screen or tmux session, use the same colors as when TERM=xterm. In a gnu screen or tmux session, TERM=screen and emacs uses a ...
5
votes
1answer
1k views
How to add color themes to Gnome-Terminal's GUI preferences?
I use Gnome-Terminal for a lot of my work, and like separating my windows by color based on the task that I'm doing, so I've set up several profiles using the Preferences GUI.
I found some color ...
4
votes
2answers
1k views
Colored man pages not working on gentoo
I have a problem using these methods to get colors in my man pages in gentoo. I've asked already in the gentoo forums but it still doesn't work, and the comments in a bug report (Bug 184604) don't ...