Skip to content

Instantly share code, notes, and snippets.

@the-nerdery-dot-info
Forked from nitriques/.bash_aliases-ubuntu
Created December 15, 2016 02:31
Show Gist options
  • Save the-nerdery-dot-info/187066e882a994c141924e4fed004fde to your computer and use it in GitHub Desktop.
Save the-nerdery-dot-info/187066e882a994c141924e4fed004fde to your computer and use it in GitHub Desktop.
My .bash_profile files. OS X, Windows (git bash) and Linux (Ubuntu/Cent OS)
alias l='ls -CF'
alias home='cd ~/'
alias apt-get='aptget'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias o='nautilus .'
alias c='xdg-open'
alias vi='vim'
alias profile='vi ~/.bash_aliases'
alias disku='du -s -h'
alias nst='netstat -lntp'
alias kernels='dpkg --list | grep linux-image-3'
# ubuntu update
alias update='sudo apt-get update && sudo apt-get upgrade && sudo apt-get upgrade linux-generic linux-headers-generic linux-image-generic'
alias install='sudo dpkg -i'
tabs 4
alias l='ls --color=auto -F'
alias ls='ls --color=auto'
alias la='l -G'
alias ll='ls -alF'
alias reload='source ~/.bash_profile'
alias ..='cd ..'
alias cd..='cd ..'
alias home='cd ~'
alias ~='cd ~'
alias cd-='cd -'
function t {
z $@ trunk
}
# this function calls top with a command filter (1st arg)
# other parameters are passed down to top
function topp {
pattern=$1
shift 1
top -p $(pgrep -d',' $pattern) $@
}
# http header
alias hh='curl -Is'
# base 64
function 64d {
node -e "console.log(new Buffer(process.argv[1], 'base64').toString())" $@
}
function 64e {
node -e "console.log(new Buffer(process.argv[1]).toString('base64'))" $@
}
alias gs='git status -sb'
alias gc='git commit -v'
alias gca='gc -a'
alias gcm='gca -m'
alias gco='git checkout'
alias gwack='git reset --hard HEAD~1'
alias gd='g --no-pager diff'
alias gds='gd --staged'
alias gdw='gd --ignore-space-change'
alias gdp='git diff'
alias gb='git branch'
alias g='git'
alias gut='git'
alias gp='git pulls'
alias gf='git fetch'
alias gfa='gf --all'
alias gpo='gp origin'
alias gf='g fetch'
alias gfo='gf origin'
alias gdev='gpo dev'
alias gl="git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
function gcat {
git cat-file -t $1 && git cat-file -p $@
}
# git checkout pull request
# gcopr upstream 22
function gcopr {
git fetch $1 pull/$2/head:pr-$2
git checkout pr-$2
}
# show files in a commit
function gsf {
git diff-tree --no-commit-id --name-only -r $@
}
# show commit content
function gsc {
gd $1 $1^1 "${@:2}"
}
function gt {
v=$1
git tag -a $1 -m "Version ${v}" $2 $3
echo "Version ${v} created"
}
alias gim='~/git-imerge/git-imerge'
export CLICOLOR=1
alias o='open -a Finder .'
alias s='open -a "Sublime Text" .'
alias home='cd ~/'
alias doc='cd ~/Documents'
alias c='open -a "Google Chrome"'
alias ss='svn status'
alias ssm='ss | grep "^[MAD]"'
alias sc='svn commit -m'
alias sup='svn up'
alias svn-clean="svn status | grep '^?' | awk '{print $2}' | xargs rm -rf"
alias svn-add="svn st | grep '^?' | sed 's/^[? ]*/\"/' | sed 's/$/\"/' | xargs svn add"
alias svn-ignore="svn propedit svn:ignore"
function sd {
svn diff $@ | colordiff
}
function sdw {
sd -x -w $@
}
function svnlol {
svn log $@ | perl -l40pe 's/^-+/\n/'
}
alias scr='svn commit --non-recursive -m'
alias sup.='sup'
alias sup¸='sup'
alias sup^='sup'
alias suo='sup'
alias o='start explorer .'
alias np='start "" "C:\Program Files (x86)\Notepad++\notepad++.exe" '
alias subl='start "" "C:\Program Files\Sublime Text 3\sublime_text.exe" '
alias sub2='start "" "C:\Program Files\Sublime Text 2\sublime_text.exe" '
alias c='start "" "C:\Program Files\Google\Chrome\Application\chrome.exe" '
alias profile='np ~/.bash_profile'
alias s='subl .'
alias ab='start "" //B //WAIT "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin\ab.exe" '
export SVN_EDITOR='"C:\Program Files\Git\usr\bin\vim.exe"'
alias ncu='winpty ncu.cmd'
alias w='cd workspace/assets/'
alias b='.. && ..'
alias v='cat package.json | jq .version'
alias bn='cat build.json | jq .lastBuild'
alias build='w;grunt;v;bn;b'
alias buildpush='sup;w;grunt build push --force;v;bn;b'
# terminal title
export PROMPT_COMMAND='echo -ne "\033]0; ${PWD##*/}\007"'
# terminal prompt
export PS1="\e[0;33m->\e[m \u \w\$(git-radar --bash) $ "
# Grunt auto-completion
eval "$(grunt --completion=bash)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment