Created by
Pam Ocampo / @pmocampo
Rachel Walker / @raychatter
Increase your productivity by maximizing your terminal’s screen real estate.
PS1 controls the prompt on your terminal’s command line.
The prompt usually looks like this (on Mac):
hostname:~ username$
What's your current prompt?
Open the terminal and type
echo $PS1
What does it return?
\h:\W \u\$
Let's change our terminal from this
To this:
Open the terminal and type:
PS1="Hello, Bash"
PS1="Hello, Bash"
vim ~/.bashrc
open ~/.bashrc
emacs ~/.bashrc
export PS1=">> "
source ~/.bashrc
Remember this?
\h:\W \u\$
How does that translate to this?
hostname:~ username$
Link to this sheet: http://git.io/vP7GgQ
Change your Bash prompt to match ours:
(05:40 PM)(username@host:~/home)
export PS1=”(\@)(\u@\h):\W “
(5:40 PM) (pamo@host):~/home
PS1="(\@)(\u@\h):\W "
(05:40 PM)(pamo@host):~/home
PS1="(\[\033[0;36m\]\@\[\033[0;37m\])(\[\033[0;35m\]\u@\h\[\033[0;37m]\[\033[0;37m\]):\[\033[0;31m\]\W "
\[\033[0;COLORCODE\]
Link to this sheet: http://git.io/vP7GgQ
\[\033[0;COLORCODE\]
Turn this
(5:40 PM) (pamo@host):~/home
Into this
(05:40 PM)pamo@host:~/home
export PS1="\[\033[0;36m\](\@)\[\033[0;32m\]\u@\h:\[\033[0;33m\]\w"
\[\033[0m\]
PS1=”(\[\033[0;36m\]\@\[\033[0m\])(\[\033[0;35m\]\u\[\033[0m\]@\[\033[0;32m\]\h\[\033[0m\]):\[\033[0;33m\]\W\[\033[0m\]“
PS1=”(${CYAN}\@${NO_COLOR})(${PURPLE}\u${NO_COLOR}@${GREEN}\h${NO_COLOR}):${YELLOW}\W${NO_COLOR}“
(05:40 PM)(pamo@host):~/home
YELLOW="\[\033[0;33m\]"
CYAN="\[\033[0;36m\]"
PURPLE="\[\033[0;95m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
PS1="(${CYAN}\@${NO_COLOR})(${PURPLE}\u${NO_COLOR}@${GREEN}\h${NO_COLOR}):${YELLOW}\W${NO_COLOR} "
Show off your prompt!
Check out our repo for additional resources http://pamo.github.io/nerdcred/