Pretty Bash Prompt

Add this to your ~/.bash_profile to get a pretty prompt.

example 1

export PS1='\n\[\e[31;22m\]\d \t\e[32;0m\n\u@\[\e[32;0m\]\H:\w>'
EG:
Fri Nov 07 09:26:20
user@host:/path>

example 2

export PS1="\[\033[1;31m\][\t]\[\033[1;34m\][\u@\H:\w]#\[\033[0;37m\] "
EG:
[10:43:59][user@host:/path]#

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

How to change the color?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <b> <i> <strong> <cite> <em> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <css>, <diff>, <drupal5>, <html>, <javascript>, <php>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.