snipt

Ctrl+h for KB shortcuts

Bash

Coloring console prompt

1
2
3
4
5
$> echo "PS1='\[\033[01;37;43m\]\[email protected]\h\[\033[00m\]:\[\033[01;37;42m\]\w\[\033[00m\]\$ '" >> ~/.bashrc
$> source ~/.bashrc

# info about colors
$> dircolors --print-database
https://snipt.net/embed/8e906b4689e535210cb1fbea20e2caa9/
/raw/8e906b4689e535210cb1fbea20e2caa9/
8e906b4689e535210cb1fbea20e2caa9
bash
Bash
5
2019-07-12T10:54:06
True
False
False
/api/public/snipt/6356/
coloring-console-prompt
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$&gt; <span class="nb">echo</span> <span class="s2">&quot;PS1=&#39;\[\033[01;37;43m\]\[email protected]\h\[\033[00m\]:\[\033[01;37;42m\]\w\[\033[00m\]\$ &#39;&quot;</span> &gt;&gt; ~/.bashrc </span><span id="L-2"><a name="L-2"></a>$&gt; <span class="nb">source</span> ~/.bashrc </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># info about colors</span> </span><span id="L-5"><a name="L-5"></a>$&gt; dircolors --print-database </span></pre></div> </td></tr></table>
color, linux, prompt