Hot answers tagged

257

To change your directory colors, open up your ~/.bashrc file with your editor nano ~/.bashrc and make the following entry at the end of the file: LS_COLORS=$LS_COLORS:'di=0;35:' ; export LS_COLORS Some nice color choices (in this case 0;35 it is purple) are: Blue = 34 Green = 32 Light Green = 1;32 Cyan = 36 Red = 31 Purple = 35 Brown = 33 Yellow = 1;33 ...


137

You can edit the settings editing the file: ~/.bashrc. Open the file: gedit ~/.bashrc. Look for the line with #force_color_prompt=yes and uncomment (delete the #). Look for the line below if [ "$color_prompt" = yes ]; then that should looks like: PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]...


128

Open ~/.bashrc in text editor and uncomment line: #force_color_prompt=yes to be: force_color_prompt=yes save then execute source ~/.bashrc


95

256-colour test pattern To get the below image, use: curl -s https://gist.githubusercontent.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263/raw/ | bash The gist bash/zsh code is shellcheck clean, and also supports "Look Ma, no subprocesses!". Alternatively, for a bash quicky: for i in {0..255} ; do printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i" if (( i =...


78

Here is my solution with Bash only: for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m " done echo done done echo "" One-liner: for x in {0..8}; do for i in {30..37}; do for a in {40..47}; do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m ";...


60

I came up with this solution: open ~/.bashrc in an editor copy this and add it at the end of .bashrc file: PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] ' save the file and restart bashrc: source ~/.bashrc For a full list of available colors and further options look up these links: wiki.ubuntuusers ...


49

cat is not able to do this. However, maybe pygments may be able to help you there. It is a python script and can be either installed via apt-get sudo apt-get install python-pygments or easily downloaded and installed via easy_install. It supports lots of source code languages and also markup languages It is used by pygmentize -g <filename>


47

You can do this in Okular if you don't mind pulling in kde dependencies. sudo apt-get install okular The option is found in Settings/Configure Okular.../Accessibility by checking Change colors then Color mode: Change Paper Color and select a color in the swatch below. Works with several pdf files I have from arxiv, but perhaps unsurprisingly, doesn't work ...


43

Finally found it! As it turns out, I was searching for the wrong term. Apparently the TTYs run on a framebuffer, which is what the colors get changed in. From this blog post but customized to use the railscasts theme colors, add the following to ~/.bashrc: if [ "$TERM" = "linux" ]; then echo -en "\e]P0232323" #black echo -en "\e]P82B2B2B" #darkgrey ...


43

To keep the markup, you need more than just a text file. I'd use HTML output to keep the colors. Install aha i.e. to "converts ANSI escape sequences of a unix terminal to HTML code" sudo apt-get install aha then save your grep (or ls) output like this: ls --color=always | aha --black --title 'ls-with-colors' > ls-with-colors.html options: --black ...


41

You can also use the colortest package. Install it with this command: sudo apt-get install colortest It provides several commands which you can use, depending on how many colors you want: colortest-16 colortest-16b colortest-256 colortest-8 Example output from colortest-16b:


36

You can try the BashrcGenerator. This is by far the easiest way to get a prompt like you want. I've noticed that the colors defined here may be different from your own system, but that's a small issue. With the generated code you can change the colors yourself. Server user: export PS1="\[\e[01;37m\][\[\e[0m\]\[\e[01;32m\]\u\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\...


35

That's strange, as I get the following : apt-cache search gpick gpick - advanced GTK+ color picker I suppose it could be in a source that you currently don't have enabled.. That being said for simple colour picking I prefer gcolor2 - Nice and simple to use and should do exactly what you require. You can install it with following command: sudo apt-get ...


35

I found a nice Python script for that on GitHub written by Justin Abrahms which also prints the hex codes of the colours. Download the script to current working directory wget https://gist.githubusercontent.com/justinabrahms/1047767/raw/a79218b6ca8c1c04856968d2d202510a4f7ec215/colortest.py give it execute permission chmod +x colortest.py Run it: ./...


33

Very simple. Add these three lines to ~/.bashrc $ vi ~/.bashrc export LS_OPTIONS='--color=auto' eval "$(dircolors -b)" alias ls='ls $LS_OPTIONS' If you want to apply the changes in a running bash session, run: source ~/.bashrc


32

All the colors, graphics, and layout details for Ubuntu can be found in the Ubuntu Design brand assets. From the colour palette page you'll find that: The Purple (CANONICAL AUBERGINE) is #772953 The Orange (UBUNTU ORANGE) is #e95420


31

You do not have problems with your terminal or terminal setting. Try this: ls --color It works, doesn't it? Most likely, you have replaced your .bashrc. You can find the original .bashrc, which for example defines the alias ls='ls --color=auto' and also color promtpts in /etc/skel/. Copy a new .bashrc with: mv ~/.bashrc ~/.bashrc.old cp /etc/skel/....


29

One possible cause could be incorrect refresh rate and (or) resolution. This was a generic issue in the time of CRT monitors being, but we could experience similar issues also with the modern monitors. So, find the the monitor's specification and check what are the native values of the refresh rate and the resolution. Or find these values in Windows [1]. ...


27

A simple one-liner that should work for most people. msgcat --color=test


24

This expands on Karthick87's answer. With the default setup Uncolored (white): file or non-filename text (e.g. permissions in the output of ls -l) Bold blue: directory Bold cyan: symbolic link Bold green: executable file Bold red: archive file Bold magenta: image file, video, graphic, etc. or door or socket Cyan: audio file Yellow with black background: ...


24

There is another possibility. Install zathura. It is a lightweight PDF, DJVU and PS reader. It is highly configurable and of course it allows changing the color of the background and the text. Just add these lines to ~/.config/zathura/zathurarc: set recolor true set recolor-darkcolor "#dcdccc" set recolor-lightcolor "#1f1f1f" I also recommend you to set ...


21

Run the following command in a terminal: gedit ~/.bashrc When .bashrc opens, locate and uncomment force_color_prompt=yes (that is, remove the hash, so it no longer looks like: #force_color_prompt=yes). Save the file, and open a new terminal window, and you should already see a change (the prompt should be Light Green, which is defined by 1;32). You can ...


19

A bit late, but perhaps I've found a quite nice, easy GUI solution: gnome-color-chooser Highlights: Completely GUI solution, no need to manually fiddle with ~/.gtkrc Only changes the settings you check. Uncheck them revert to default. Changes are applied as soon as you click Apply. No need to switch themes back and forth No need of sudo (but changes are ...


19

I realize this is an old question, but I just stumbled upon it and found the answer. After you separate the image into the CMYK channels, you get a .tif image with 4 layers (one for each color). This image looks inverted because each area where this is white/grey represents a certain amount of cyan, magenta, yellow, or black. Once you have this, just go to ...


19

Not from cat itself but you can use something like source highlite or supercat or highlight Source-highlight This program, given a source file, produces a document with syntax highlighting. It also provides a C++ highlight library (new) (since version 3.0). Source-highlight reads source language specifications dynamically, thus it can be easily ...


18

None of the answers here include the 256 color options in the latest versions of Ubuntu. I'm color deficient (some colors give me trouble near each other) so the default blue directory on black is real hard for me to read. What follows is my research to change that. Type dircolors -p |less to see your current color code. The default .bashrc should already ...


15

You can edit ~/.dircolors, if it doesn't exist you can create it with: dircolors -p > ~/.dir_colors As the example here shows, you can have this in your .bashrc: eval `dircolors ~/.dir_colors` alias ls="ls --color=auto"


14

As from this answer here, you can use the python-pygments packages to highlight stuff. First do: sudo apt-get install python-pygments python3-pygments then: pygmentize -g FILENAME then have a go: You can also set it as an alias, like in the answer I linked - basically, run this: echo "alias catc='pygmentize -g'" >> ~/.bash_aliases chmod +x ~/....


14

24bit support is enabled by default but gnome-terminal has to be in version linked against libvte >= 0.36 (as stated on the page you mentioned). Which unfortunetly is not the case in the latest ubuntu 14.04 (at the time of writing). As a workaround you may try: sudo add-apt-repository ppa:gnome3-team/gnome3-staging sudo apt-get update sudo apt-get ...


14

GNOME Terminal 3.32 (debuted in Ubuntu 19.04) changed the default of the "Show bold text in bright colors" option to disabled. As another answer nicely shows you, one possible fix is to revert that setting. However, this change was intentional and is going to stay the default. There's a legacy confusion about the meaning of the 1 (or 01) in the escape ...


Only top voted, non community-wiki answers of a minimum length are eligible