Questions tagged [colors]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
16 views

Is there a way to prevent bash-completion using “broken link” colours?

If you set up colored-stats so that you get coloured tab complete for (for example) cd (see question) then it also sets colouring for other tab completion like git and docker sub-commands. This is ...
24
votes
5answers
23k views

“Friendly” terminal color names in shell scripts?

I'm aware of libraries in languages such as Ruby and Javascript to make colorizing your terminal scripts easier by using color names like "red". But is there something like this for shell scripts in ...
50
votes
9answers
77k views

How to turn off color with `ls`?

It is normally nice to have color output from ls, grep, etc. But when you don't want it (such as in a script where you're piping the results to another command) is there a switch that can turn it off?...
1
vote
2answers
561 views

Changing the color of git branch output?

In my .bash_profile I have a parse_git_branch function from the internet, and a PS1 to color some of my output. If possible, I would like to make my git branch name colored red, instead of white. ...
1
vote
0answers
76 views

Emulating Synesthesia: How to change the colour of words based on the first letter in a system-wide manner?

I want to try to understand how Daniel Tammet, an autistic synesthetic savant, sees words, at least in the aspect of them having colour. To this aim, I want to colour every word appearing on the ...
0
votes
1answer
868 views

using ansi escape codes to change the background color in xfce4-terminal

This works to change the background color for the entire terminal with xterm: printf '\033]10;%s\a\033]11;%s\a' Blue Red It doesn't work in xfce4-terminal, tho. Is there something that will work? ...
4
votes
3answers
39k views

How do you display xterm colors with putty/bash?

Putty has this "allow terminal use xterm 256 colour mode" that I'd like to use, but I don't know how. I've been using a color.sh script to output echo statements and commands with colors, and I want ...
2
votes
2answers
1k views

how to disable color in output of 'top' command?

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 ...
2
votes
1answer
870 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 pid,ppid,time,user,tty,%cpu,%...
1
vote
2answers
45 views

Debian detects printer family, but no double sided printing; colors are inaccurate

On Debian 9.8 I use a Canon PIXMA MG2555 printer. 1) A global driver for PIXMA MG2500 series printers has been installed automatically by GNOME. It seems that no more accurate driver exists, and I ...
0
votes
2answers
973 views

Apply Colors to Terminal Output to highlight URL & Others

I am looking for a way to apply colors to highlight URLs (http://....) and IP @ in the output of a terminal command. Example would be with a wget command for example where I would like to be able to ...
1
vote
1answer
1k views

change LS_COLORS behaviour

I am trying to modify LS_COLORS behavior. Presently it (say for sh or py), changes color depending on if it is executable or not, as shown here But, I want all my script, executable or not, have ...
13
votes
4answers
3k 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 color ...
0
votes
1answer
19 views

How to turn colors for vim.tiny without internet access?

readlink -f 'which vi' output: /usr/bin/vim.tiny vi --version output: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 17 2016 07:08:19) Included patches: 1-488, 576 Extra patches: 8.0.0056 ...
4
votes
1answer
496 views

change ls color on OpenWrt

I am not able to change the color of dir entries for ls command (dark blu is a very annoying color to read) on my OpenWrt device. I've added the line LS_COLORS=$LS_COLORS:'di=0;37:' ; export ...
0
votes
1answer
1k views

zsh, oh-my-zsh, change current directory color

I've installed oh-my-zsh withe the "pure" theme (https://github.com/sindresorhus/pure) and the current directory is now being shown at the prompt. The problem is that it's shown in a dark blue color ...
0
votes
0answers
21 views

Colored bash prompt and tab title

I cannot seem to get both a colored terminal prompt and the tab title to change at the same time. function tab_title() { local tab_replace="${USER}@${HOSTNAME}" local tab_orig="$PS1" ...
0
votes
0answers
23 views

Real-time color change in terminal (before user sends the command)

I could not find a better way to write the title, so sorry if it is not as specific as it should. For my case, I would like to make the first word (that we know it will be separated of the rest of ...
11
votes
3answers
2k 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 ...
1
vote
3answers
1k views

Is it possible to color the output of `aafire`?

The program seems cool, but giving it a red color really makes it look like my computer is on fire. I think using grep or similar piping command can do the trick, but I see that it prints ASCII escape ...
4
votes
1answer
176 views

is it possible to colors the prompt for (reverse-i-search) context menu?

I am using fedora 25 but I think this is a general behavior on unix system. When I ctrl+r in a command-line environment I can start to type in and anything I type will get to be matched backward in ...
0
votes
1answer
1k views

Colorize line number in grep

Is there a way to colorize line numbers when using grep with the -n option? For example, echo "hello" | grep -n lo outputs 1:hello where lo is colorized in red (being the match). Can I configure ...
1
vote
1answer
314 views

Can the Linux console display 16 colors?

I'm reading the manual page terminfo and I wonder if the Linux console may use the terminal type linux-16color instead of the terminal type linux. prompt% infocmp linux linux-16color comparing linux ...
1
vote
0answers
37 views

Set different colors for single terminal instance [closed]

I want to redefine colors for single terminal instance (not all of them). The way I expect that to work is comparable to environment variables: after I "export" them they apply only to that ...
2
votes
2answers
3k views

colored bash does not work as root user

I have noticed that when I ssh to a server and then su to the root user, I do not get color in bash. In this specific case when I say "do not get color in bash" I am talking about editing files with ...
3
votes
1answer
1k views

set tab color in a tabbed terminal emulator

I would like to set in my terminal emulator (i.e. gnome-terminal) the color of the tabs like in the osx's terminal emulator. Is there this feature in any of the linux terminal emulator plethora? EDIT:...
1
vote
1answer
180 views

Tmux use bright colors?

I'm using iTerm and I was wondering if it was possible to use the "bright" colors in the Tmux config file. I googled this and I seen something that did fg=cyan,bg=black,bright and when I tried this, ...
68
votes
12answers
41k 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) ...
3
votes
1answer
358 views

Force apt(8) to generate color through pipe?

Output from apt listis often tens of thousands line long, so I usually run instead apt list | less # or another program but there's no color in this way. Can I retain the color while piping apt(8)'s ...
-1
votes
3answers
47 views

Color line, but don't show the matched pattern [closed]

So i have this text: 2019/06/16 22:36:28 (UNIVERSE) * @{EE3F}Trytrytry sagt: @{F80F}going afk for a bit I want to color the whole line in red for example. Then remove the unecessary parts to: 22:...
1
vote
1answer
73 views

bash echo color to textfile [closed]

How can I write colored text using bash? RED='\033[0;31m' GREEN='\033[0;32m' NC='\033[0m' greprc=$? if [[ $greprc -eq 0 ]] ; then echo -e "${GREEN} converged${NC}" >>log else echo -e "${RED}...
216
votes
10answers
230k views

Better colors so comments aren't dark blue in Vim?

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? ...
2
votes
1answer
49 views

How to fix konsole `\033[0m` not working start from second page of scroll?

I noticed konsole has problem to reset color on next page of scrolling, as screenshot below, run with command for i in {1..100}; do echo "$i"; echo -en '\033[1;42m ...
22
votes
2answers
3k 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 ...
19
votes
2answers
3k views

Is there a colour picker that works with Wayland or XWayland?

I tried gpick, gcolor2, gcolor3, pick, pychrom and none of them seem to work with Wayland. I am running Arch Linux 64-bit with GNOME 3.22.1 through XWayland (default since 3.22.x). I don't want to ...
5
votes
3answers
8k views

How to force lp from CUPS to print in grayscale?

I want to print an image from a command line: lp -o scaling=//100// image.jpg How can I force it to be printed in grayscale?
0
votes
1answer
32 views

How can I get ls filetype colors?

I'm working on a project that consists to recode the behavior of the ls command, I'm wondering if there is a way to get the exact colors ls uses for different filetypes to reuse them in my code, ...
1
vote
1answer
31 views

Convert image into 8-Bit color space?

Is there a way to use convert to transform an image into an 8-bit bitmap?
17
votes
3answers
2k views

How does a program decide whether or not to have coloured 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
26 views

Why don't I see escape sequences in redirected stream OR how is color output implemented? [duplicate]

When running ls in terminal, output is variously colored: AFAIK this colorasing is accomplished by espace sequences (vt). But running ls | hexdump -cC shows only characters and LFs. Redirection to ...
0
votes
3answers
436 views

How to display color by piping command to less?

When I use: msgattrib --untranslated pl.po to see untranslated strings from po file I've got strings in color, but not when I use: msgattrib --untranslated pl.po | less
35
votes
2answers
26k views

How do I change the color of the pane dividing lines in tmux?

I've used the following command to change the color of the status bar at the bottom of the screen: set -g status-bg colour244 But I don't know how to change the color of the lines that divide the ...
78
votes
5answers
58k 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. 125)...
10
votes
2answers
1k views

How to colourise hidden files in `ls` file listings?

LS_COLORS environmental variable lets you decide on colours for different file types for GNU coreutil's ls command, such as directories, regular files, links etc. I suppose that dot files are ...
3
votes
2answers
5k views

Setting up LS colors with a human-readable script in tcsh

I have a shell script (set_up_my_ls_colors.sh) that, if I call from my shell, it configures my color scheme for ls. The nice thing about the script is that it allows me to configure colors in a human-...
58
votes
2answers
35k 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 ...
1
vote
2answers
22 views

Signal neovim to reread its configuration

I have a script with which I toggle between a dark and a light colorscheme. The terminal emulator I use (termite) rereads its configuration when receiving the signal USR1, so when toggling my ...
1
vote
2answers
155 views

Bash - print first line of textfile (csv) bold

I have a text (csv) file like this: Date:;Time:;Value:; 20181202;112044;38274658392; 20181207;121356;94843726283; 20181221;221012;93938272189; 20181230;071234;93736473783; 20190107;011022;27339393022;...
1
vote
2answers
2k 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 ...
43
votes
7answers
15k 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 ...