Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use the Linux based syntax in one of your startup scripts. Just tested this on an OS X Mountain Lion box.</p> <p>eg. in your <code>~/.bash_profile</code></p> <pre><code>export TERM="xterm-color" export PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ ' </code></pre> <p>This gives you a nice colored prompt. To add the colored <code>ls</code> output, you can add <code>alias ls="ls -G"</code>.</p> <p>To test, just run a <code>source ~/.bash_profile</code> to update your current terminal.</p> <p>Side note about the colors: The colors are preceded by an escape sequence <code>\e</code> and defined by a color value, composed of <code>[style;color+m]</code> and wrapped in an escaped <code>[]</code> sequence. eg. </p> <ul> <li>red = <code>\[\e[0;31m\]</code></li> <li>bold red (style 1) = <code>\[\e[1;31m\]</code></li> <li>clear coloring = <code>\[\e[0m\]</code></li> </ul> <p>I always add a slightly modified color-scheme in the root's .bash_profile to make the username red, so I always see clearly if I'm logged in as root (handy to avoid mistakes if I have many terminal windows open).</p> <p>In <code>/root/.bash_profile</code>:</p> <p><code>PS1='\[\e[0;31m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '</code></p> <p>For all my SSH accounts online I make sure to put the hostname in red, to distinguish if I'm in a local or remote terminal. Just edit the <code>.bash_profile</code> file in your home dir on the server.. If there is no <code>.bash_profile</code> file on the server, you can create it and it should be sourced upon login. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload