I would like to colorize my ssh banner. I know I can perform it like so:   In /etc/profile I can put:   echo -e "\e[1;31m Colorful text" echo -e "\e[0m Reset"   But I have some ASCII art in the banner with special characters. Is there any way to colorize this without escaping every single special char in the ASCII art?
102835
It's possible to configure a banner for sshd that is to be displayed as a connection is opened, via Banner /etc/motd.ssh in sshd_config.  Note that this is displayed before the authentication occurs, and even when an interactive shell is not launched (e.g. via scp).  If this banner contains characters outside of the printable ASCII range, they seem to be escaped, however.  Is there any way to either disable this escaping, or an alternative way to send textual output back to the client on connection which supports such characters outside of the printable-ASCII range?    This would be useful both for colour escape sequences and Unicode characters.   Related:  (not a duplicate, however, as this question is about another kind of banner, not about color)
68215
I have a file with ANSI colors.  test.txt: \e[0;31mExample\e[0m  I would like to display the content of this file in a terminal, like cat does, but I would like to display the colors as well.
42872
I am trying something like:  set pwd = abc&amp;123 echo password %pwd%   I get the result as...   '123' is not recognized as an internal or external command, operable program or batch file.  password abc   Is the system like this or is there an escape for such characters?
100276
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 plan to do something like this:  $ command-that-produces-colored-output | stripcolorcodes &gt; outfile
74709
I'm trying to make other applications (like putty and SecureCRT) use the same font as windows CMD.  What exactly is this "Raster Fonts" Font and how do I get it?
110695
I'd like to add the Unicode skull and crossbones to my shell prompt (specifically the 'SKULL AND CROSSBONES' (U+2620)), but I can't figure out the magic incantation to make echo spit it, or any other, 4-digit Unicode character. Two-digit one's are easy. For example, echo -e &quot;\x55&quot;, . In addition to the answers below it should be noted that, obviously, your terminal needs to support Unicode for the output to be what you expect. gnome-terminal does a good job of this, but it isn't necessarily turned on by default. On macOS's Terminal app Go to Preferences-&gt; Encodings and choose Unicode (UTF-8).
44046
There are a number of tutorials/posts online (e.g. ) about how to customize your prompt in bash by setting PS1.  Is there a way to customize the color/bolding of the command I type?    In other words, as an example lets say that I wanted a green prompt, a bold blue command, and then output in whatever colors would be default.  In the example below, I already know how to make "joe&gt;" show as green, blue, bold, whatever by setting PS1.  But is there a way I can I make git status show as bold for example?  joe&gt; git status # On branch master # Your branch is ahead of 'origin/master' by 2 commits. # ...
52656
How can I use/display characters like ♥, ♦, ♣, or ♠ in Java/Eclipse?  When I try to use them directly, e.g. in the source code, Eclipse cannot save the file.  What can I do?  Edit: How can I find the unicode escape sequence?
108921
I'd like to make commands I've typed (input) into terminal stand out from all the output.   For example:  imac:~ buster$ chmod -R g-w myfolder  imac:~ buster$ cd myfolder imac:myfolder buster$ ls -l total 0 drwxr-xr-x   9 root  admin   306 Apr 20  2010 bin drwxr-xr-x   7 root  admin   238 Apr 20  2010 include drwxr-xr-x  73 root  admin  2482 May 18 17:16 lib drwxr-xr-x   6 root  admin   204 Apr 20  2010 man imac:myfolder buster$ echo Go Giants! Go Giants!  bold jumps to mind but I'd accept a color or even highlighting the whole line...   I'm sure there's a way to do this but it's not obvious to me...  thanks!
91903
I use a coloured bash prompt like so:  blue=$(tput setaf 4) reset=$(tput sgr0) bold=$(tput bold) export PS1='($?) \[$bold$blue\]\u@\h:\w\[$reset\]$(__git_ps1)&gt; '   I usually work in a terminal window (gnome-terminal) but sometimes in a full-screen console (CTRL+ALT+F3).   My coloured prompt is fine in the GUI terminal but hard to read in full-screen because the colours look different. So I'd like to use a different colour (e.g. cyan=$(tput setaf 6)), when in console window. For this to work I need to figure out which mode I'm currently in and set my $PS1 accordingly.  I tried the tty command. It gives  /dev/pts/0  # GUI terminal /dev/tty3   # console    I also tried to examine the value of $TERM. It gives  xterm-256color  # GUI terminal linux           # console   Both of them would work for me but my question is: Is that the correct way to reliably distinguish console vs. terminal or are there better ways? I'm on 17.10.1 if that matters.
80271
I'd like to colorize the names of header files included in angle brackets (&lt;>) in my C examples formatted by the listings package. In the MWE I'd like &lt;brackets.h&gt; to be orange too like "quotes.h". I don't want to do that manually with escapes in every listing but globally. I have tried various crude things including the use of keywordcommentsemicolon (which did not work at all because it is an undefined key although it is mentioned in the documentation... does it need to be enabled?). The most promising results were achieved by using morecomment=[s]{&lt;}{&gt;}. However, that would colorize everything following a &lt;... which is not that uncommon in C ;) The solution should work independently from the documentclass, especially beamer should work, and preferably work with common listings options (i.e., not change the behavior of other formatting options such as identifierstyle.  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \usepackage{xcolor} \definecolor{darkorange}{HTML}{C87B0F}  \usepackage{listings} \lstset{language=C,captionpos=b} \lstloadlanguages{C}  \lstset{%     stringstyle=\color{darkorange},     identifierstyle={\color{blue}}. }  \begin{document}  \begin{lstlisting}[gobble=4]     #include &lt;stdlib.h&gt;     #include "quotes.h"      int main(int argc, char **argv) {          if (argc &lt;= 3)             return 0 &gt; **argv;         return EXIT_SUCCESS;     } \end{lstlisting}  \end{document}
113048
This has sort of been touched on in some other postings, but for path reasons I would like to avoid using a shell script and just use ImageMagick's (IM) convert command line executable directly from a \immediate\write18{...} in a macro command, but in my IM convert instructions I need to pass the % (ASCII 37) as part of a macro.  However I try to conceive of making a % - and I have tried numerous ways(!) I always end up getting the Latex code I am using for the % passed through to the command line.  The obvious one, \% goes to the shell as \% directly and that is the pattern followed by all other options.  What I obviously seem to need is some way to generate the ASCII or unicode for % and get that to the shell from LaTeX via \write18 or other.  Or have some sort of temporary suspension on the LaTeX usage of % so that it can be part of a \write18{} and not break the command as a comment starter, and so be passed with out needing to be LaTeX escaped first.
60857
I just ran across a screenshot of someone's terminal:    Is there a list of all of the characters which can be used in a Bash prompt, or can someone get me the character for the star and the right arrow?
22384
I discovered that when I do ssh to a machine using OS X 10.6 and use mc I do not see the .  This does not happen if I open terminal and start mc.  I'm connecting using putty configured to use xterm-color, configuraton that works just fine if I do ssh to a linux machine.  The mc from  OS X is version 4.7.0 (installed using macports).  What locale returns:   LC_CTYPE="C" &lt;== ssh LC_CTYPE="UTF-8" &lt;== Terminal.app    ssh: mc > display bits shows: 7-bit ASCII (changing does not help, it defaults to the same value) Terminal.app: mc > display bits shows: UTF-8  The environment shows TERM=xterm-color in both cases Terminal.app and ss but mc looks different.  I filed a bug to mc with this information at
11926
I'm trying to set an alias for sudo !! in Bash. I tried alias sbb='sudo !!', but it interprets that as a literal  !! and prints   sudo: !!: command not found   If I use double quotes, it substitutes the double bang in the string itself, so that doesn't work.  Is there any way to make this work? Or an alternative alias? `
1075
My current prompt is colorized and edited as so -  #!/bin/bash  # GIT Prompt help if tput setaf 1 &amp;&gt; /dev/null; then     tput sgr0; # reset colors     bold=$(tput bold);     reset=$(tput sgr0);     txtund=$(tput sgr 0 1);     black=$(tput setaf 0);     blue=$(tput setaf 33);     cyan=$(tput setaf 37);     green=$(tput setaf 64);     orange=$(tput setaf 166);     purple=$(tput setaf 125);     red=$(tput setaf 124);     violet=$(tput setaf 61);     white=$(tput setaf 15);     yellow=$(tput setaf 136); else     bold='';     reset="\e[0m";     black="\e[1;30m";     blue="\e[1;34m";     cyan="\e[1;36m";     green="\e[1;32m";     orange="\e[1;33m";     purple="\e[1;35m";     red="\e[1;31m";     violet="\e[1;35m";     white="\e[1;37m";     yellow="\e[1;33m"; fi; ORIG=$PS1 HOST=$HOSTNAME PS1="\[${txtund}${green}\]${HOST}\[\[${reset}\]"; PS1+="\$(prompt_git \"\[${white}\] on \[${violet}\]\")"; PS1+="\[${reset}\]"; PS1+="\[ at - ${orange}\W\]"; PS1+="\[${reset}\]"; PS1+="\[ - \u \]"; PS1+="\n\$ ";   I know that the line  PS1+="[ - \u ]"; will show me my current user. However, I want that section to be red if it is root. All other users should be the default color of gray. Is there a way to change the color in that section based off of current user or should I just declare a variable and use an IF statement to insert that section or a modified section with red as a color?  My expected output is gray named user for all normal users. Root should be red. This is BASH.
86371
I admit that I use a somewhat long-winded bash prompt:  --(username)-(Wed April 01|12:00:00)--(~ $  Recently, I got the bright idea to change it so that depending on the exit value from the previous command, if success, the interior elements of the ()'s would be green, and if failure, they would be red.  I got it working for the most part (some odd exit statuses will change the color to something else, but I'm ok with it), but when typing a command which is more than one line, and causes the terminal to scroll, the prompt disappears!  My prompt worked fine when there was no color, so I'm guessing it is related to my color escaping, and particularly my unclosed ['s, but I can't pin it down.  #.profile export PS1='--(\e[$((32-${?}))m\u\e[0m)-(\e[$((32-${?}))m\d\e[0m|\e[$((32-${?}))m\T\e[0m)--(\e[$((32-${?}))m\w\e[0m \$ '  Thanks in advance!