Terms of Service Privacy Policy Contact Us

leistware.com

Messing With The Prompt


export PS1="e[0;31mue[0;37m@e[0;36mhe[0;37m:e[0;33mwe[0;37m:e[0;33m e0m > "

Take this apart:

  • export PS1=" - is the command, it exports the command line PS1
  • e[0;31m - changes the color to red
  • u - this adds the user to the prompt (kennyl)
  • e[0;37m - changes the color back to white
  • @ - adds the @ symbol to the prompt (@)
  • e[0;36m = changes the color to cyan
  • h - adds the hostname to the prompt (magnum)
  • e[0;37m - changes the color back to white
  • : - adds a colon to the prompt (:)
  • e[0;33m - changes the color to yellow
  • w - displays the current working directory (~/Downloads)
  • [0;37m - turns the color back to white again
  • : - adds a colon to the prompt after the current directory (:)
  • e[0m - turns the color back to the default
  • > - adds a > to the end of the prompt (>)

The resulting prompt looks like this:

kennyl @ magnum : ~/Downloads : 17:01:00

CREATED 2012-11-17 03:36:57.0

00-17-CC

UPDATED 2012-11-17 03:36:57.0

Knowledge

Page Server: Ithica

DBID: db.wam

©2012 Leistware Data Systems

      Hello anonymous