Bash - .aliases
ls
Display in long list format
alias ll='ls -l'
Do not list . and ..
alias la='ls -A'
List entries in columns with file indicator (/ - directories, * - executables, @ - aliases, | - pipes, = - sockets)
alias l='ls -CF'
Explain what is being done by default when copying, moving or removing files
alias mv='mv -v'
alias rm='rm -i -v'
alias cp='cp -v'
Edit hosts file
alias hosts='sudo $EDITOR /etc/hosts'
Recursively delete .DS_Store files
alias cleanup_dsstore="find . -name '*.DS_Store' -type f -ls -delete"
Usefull
alias extip='curl -s http://whatismijnip.nl |cut -d " " -f 5'
BREW stuff
alias brew_update="brew -v update; brew upgrade --force-bottle --cleanup; brew cleanup; brew cask cleanup; brew prune; brew doctor; npm-check -g -u"
GIT stuff
Do not show untracked files in git status
alias gs='git status -uno'
Undo a git push
alias undopush="git push -f origin HEAD^:master"
alias gsa='git status'
alias pp='git pull && git push origin HEAD'
alias master="git checkout master"
MERCURIAL stuff
alias hgs="hg status"
function merge_to {
current_branch=`hg branch
if [ -z "$1" ]
then
echo ">>> Set branch to which you want merge $current_branch !!!"
else
echo "Merge branch $current_branch to $1: [y/n]"
read merge
if [ "$merge" == "y" ]; then
hg pull && hg push --new-branch && hg up $1 && hg merge $current_branch && hg diff
echo "Merging: $current_branch"
fi
fi
}