Skip to content

Instantly share code, notes, and snippets.

@nilsoberg2
Last active October 20, 2021 19:55
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 nilsoberg2/9e3a3a1eda7bd6836713cd9b2444af80 to your computer and use it in GitHub Desktop.
Save nilsoberg2/9e3a3a1eda7bd6836713cd9b2444af80 to your computer and use it in GitHub Desktop.
My .bash_profile with aliases and git branch info
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
alias ll='ls -al --color=auto'
alias lll='ls -l --color=auto'
alias llh='ls -alh --color=auto'
alias lc='wc -l'
alias vi='vim'
alias scls='screen -ls'
alias scc='screen -xS'
alias lr='ls -alrt'
alias fp='readlink -f'
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\W\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
function mark {
export $1=`pwd`;
}
shopt -s direxpand
export IGNOREEOF=5
export SUDO_EDITOR=/usr/bin/vim
search() {
mat=$1
fpat=$2
dir=$3
find $dir -name "*.$fpat" -exec grep -Hn "$mat" {} \;
}
searchfile() {
mat=$1
fpat=$2
dir=$3
find $dir -name "$fpat" -exec grep -Hn "$mat" {} \;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment