Skip to content

Instantly share code, notes, and snippets.

@sarah-j-smith
Last active July 2, 2021 02: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 sarah-j-smith/9eb3ca97aafc57b6f8ebd9c09bb76543 to your computer and use it in GitHub Desktop.
Save sarah-j-smith/9eb3ca97aafc57b6f8ebd9c09bb76543 to your computer and use it in GitHub Desktop.
Simple .bashrc that creates a blue prompt line with the current path. The .bash_profile also turns on colorisation for `ls` (list files) output; and has some examples for other improvements.
source ~/.bashrc
# Have an ls that is in color by default
alias ls='ls -G '
# Use the tree command - need to install it first from here
# http://andre-als.blogspot.com.au/2012/02/how-to-install-command-tree-for-mac.html
alias tree='tree -C '
# Create a nice short cut for git logs
alias gitshort='git log --pretty=format:"%h%x09%an%x09%ad%x09%s"'
# Use a personal bin directory for handy scripts
PATH="$HOME/bin:$PATH"
export PS1="\[\033[1;34m\]\w $\[\033[0m\] "
export PS2="> "
export LSCOLORS=gxfxcxdxbxegedabagacad
export CLICOLOR=1
export PS1="\[\033[1;32m\]\w $\[\033[0m\] "
export PS2="> "
@sarah-j-smith
Copy link
Author

sarah-j-smith commented Oct 1, 2017

To install on Mac, right-click the Raw buttons above and choose download. Then using the Terminal / command line:

mv ~/Downloads/bash_profile.txt ~/.bash_profile
mv ~/Downloads/bashrc.txt ~/.bashrc

These work great on Mac and may work on other machines with a Unix-like shell. After installing every new Terminal window will show the nice colorised output - so start a new Terminal now and test it out.

@sarah-j-smith
Copy link
Author

Added an updated set of options for dark background terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment