Skip to content

Instantly share code, notes, and snippets.

@shammelburg
Created September 28, 2017 08:15
Show Gist options
  • Save shammelburg/761126d87602a3065bed1a975d5aa15b to your computer and use it in GitHub Desktop.
Save shammelburg/761126d87602a3065bed1a975d5aa15b to your computer and use it in GitHub Desktop.
Bash Commands
// load bash profile with permission
// write your lines and crtl+o to write - ctrl+x to exit
sudo nano ~/.bash_profile
// if bash profile does not exist
touch ~/.bash_profile
// refresh bash profile after adding alias, etc.
source ~/.bash_profile
// add alias
alias <alias_name>='your command line'
// git branch support
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment