Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

158 lines (124 sloc) 4.993 kb
# .bashrc
# platform {
# --------------------------------------------------------------------------------
platform='unkown'
unamestr=`uname`
if [[ "$unamestr" == "Linux" ]]; then
platform='linux'
elif [[ "$unamestr" == "Darwin" ]]; then
platform='mac'
fi
# }
delrec() {
# delete files matching pattern in all subfolders recursively
find . -name "$1" -print0 | xargs -0 rm -rfv ;
}
tacf () {
# reverse of cat
# alternatives are sort -r, tail -r
awk '1 { last = NR; line[last] = $0; } END { for (i = last; i > 0; i--) { print line[i]; } }'
}
decode64 () {
# base 64 decode
echo "$1" | base64 -D ; echo
}
# aliases {
# --------------------------------------------------------------------------------
alias ..='cd ..'
alias ...='cd .. ; cd ..'
alias ....='cd .. ; cd .. ; cd ..'
alias cdd='cd -' # go to previous directory
alias ri='rm -i'
alias rf='rm -fv'
alias rr='rm -fv -r'
alias srm='sudo rm -i'
alias srf='sudo rm -fv'
alias srr='sudo rm -fv -r'
alias cpi='cp -i'
alias cri='cp -iR'
alias cpf='cp -f'
alias crf='cp -fR'
alias mv='mv -i' # prevent move from overwriting existing files
alias la='ls -hAF' # show all files
alias lA='ls -lhAF' # show all files (extended)
alias la1='ls -hAF */' # show all files and folders with first level contents
alias lA1='ls -lhAF */' # show all files and folders with first level contents (extended)
alias la2='ls -hAF */*/' # show all files and folders with second level contents
alias lA2='ls -lhAF */*/' # show all files and folders with second level contents (extended)
alias ll='ls -F' # show files
alias lL='ls -lhF' # show files (extended)
alias ll1='ls -F */' # show files and folders with first level contents
alias lL1='ls -lhF */' # show files and folders with first level contents (extended)
alias ll2='ls -F */*/' # show files and folders with second level contents
alias lL2='ls -lhF */*/' # show files and folders with second level contents (extended)
alias lz='ls -lhS' # show files sorted by size
alias lZ='ls -lhSA' # show all files sorted by size
alias lt='ls -lht' # show files sorted by time (most recent first)
alias lT='ls -lhtA' # show all files sorted by time (most recent first)
alias lr='ls -lhR' # show files recursive
alias lR='ls -lhRA' # show files recursive (include hidden)
alias lf='ls -l | grep -v "^d"' # show only files
alias lF='ls -Al | grep -v "^d"' # show only files (include hidden)
alias ldir='ls -l | grep "^d"' # show only directories
alias lDir='ls -Al | grep "^d"' # show only directories (include hidden)
alias gal='git alias'
alias gad='git ad'
alias gap='git ap'
alias gbc='git bc'
alias gbh='git bh'
alias gbm='git bm'
alias gbr='git br'
alias gca='git ca'
alias gci='git ci'
alias gcm='git cm'
alias gdc='git dc'
alias gdf='git df'
alias gds='git ds'
alias ghc='git hc'
alias ghm='git hm'
alias gho='git ho'
alias glg='git lg'
alias glo='git lo'
alias glp='git lp'
alias gls='git ls'
alias gpo='git po'
alias grh='git rh'
alias grs='git rs'
alias gru='git ru'
alias gst='git st'
alias gtp='git tp'
alias gtu='git tu'
alias print-path='echo -e ${PATH//:/\\n}' # print the current path
alias print-libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}'
alias get='curl -C - -O' # curl get request
alias delf='delrec'
alias mkdir='mkdir -p' # mkdir make intermediate directories
alias g='grep -i'
alias f='find . -iname'
alias lk='ln -s' # symbolic link
alias ducks='du -cks * | sort -rn|head -11' # list the size of all folders and files
alias systail='tail -f /var/log/system.log' # system log
alias profileme="history | awk '{print \$2}' | awk 'BEGIN{FS=\"|\"}{print \$1}' | sort | uniq -c | sort -n | tail -n 20 | sort -nr"
alias df='df -h' # disk usage
alias untar='tar -xvzf'
alias suntar='sudo tar -xvzf'
alias vjar='jar -tvf' # jar (view jar contents)
alias sunzip='sudo unzip'
alias sbunzip2='sudo bunzip2'
alias exusr='chmod u+x' # give execute permissions to current user
alias exall='chmod ugo+x' # give execute permissions to all users
# fuzzy aliases require selecta (https://github.com/garybernhardt/selecta)
# fuzzy cd to a directory
alias cdf='cd $(find . -maxdepth 2 -type d | selecta)'
# fuzzy reply a previous command (similar to ^R)
alias repl='$(cat $HOME/.bash_history | sort | uniq | selecta)'
# fuzzy kill a process
alias killf="ps aux | awk -F\" \" '{\$1=\$3=\$4=\$5=\$6=\$7=\$8=\$9=\$10=\"\"; print \$0}'| selecta | awk '{ print \$1 }' | xargs kill -9"
# fuzzy cat a file
alias catf='cat $(find . -maxdepth 2 -type f | selecta)'
if [[ $platform == 'mac' ]]; then
alias tac='tacf'
export -f tacf
fi
# }
# vim: set foldmarker={,} foldlevel=0 foldmethod=marker:
Jump to Line
Something went wrong with that request. Please try again.