Skip to content

Instantly share code, notes, and snippets.

@jlcorra
Last active June 20, 2018 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlcorra/8f7f6bd02ff0af4b8a22 to your computer and use it in GitHub Desktop.
Save jlcorra/8f7f6bd02ff0af4b8a22 to your computer and use it in GitHub Desktop.
Minimal .profile and .bashrc for colorful bash prompts
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='\[\e[1;36m\]\u\[\e[0m\]@\[\e[1;32m\]\h \[\e[1;34m\]\w \[\e[0m\]\$ '
# Alternative red prompt for root
#PS1='\[\e[1;31m\]\u\@\h \[\e[1;34m\]\w \[\e[0m\]\$ '

Minimal .profile and .bashrc for colorful bash prompts

Adds some color to bash shell prompts :). Based on Arch's default .bashrc and .profile skel files.

Debian

Debian's skel files are long and scary, but well commented. Look for the following line in ~/.bashrc:

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}<HERE!>'
else

OS X

OS X is a different beast altogether. On Mountain Lion and higher, you can place the following lines in ~/.bash_profile:

export PS1='\[\e[1;36m\]\u\[\e[0m\]@\[\e[1;32m\]\h \[\e[1;34m\]\w \[\e[0m\]\$ '
export CLICOLOR=1

Or, if you want a shell that looks closer to the default, use these:

export PS1='\[\e[1;32m\]\h\[\e[0m\]:\[\e[1;34m\]\w \[\e[1;36m\]\u\[\e[0m\]\$ '
export CLICOLOR=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment