Created
November 11, 2013 09:14
-
-
Save The-Yoda/7410251 to your computer and use it in GitHub Desktop.
Aliases for bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# enable color support of ls and also add handy aliases | |
if [ -x /usr/bin/dircolors ]; then | |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
alias ls='ls --color=auto' | |
#alias dir='dir --color=auto' | |
#alias vdir='vdir --color=auto' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
fi | |
# some more ls aliases | |
alias ll='ls -alF' | |
alias la='ls -A' | |
alias l='ls -CF' | |
alias rt='reset' | |
alias c='clear' | |
alias install='sudo apt-get install' | |
alias remove='sudo apt-get remove' | |
alias update='sudo apt-get update' | |
alias upgrade='sudo apt-get upgrade && sudo apt-get dist-upgrade' | |
alias pull='git pull' | |
alias push='git push' | |
alias clone='git clone' | |
alias commit='git commit -m' | |
alias gcd='cd ~/git' | |
alias lhost='cd ~/php' | |
alias ..1='cd ..' | |
alias ..2='cd ../../' | |
alias ..3='cd ../../../' | |
alias ..4='cd ../../../../' | |
alias ..5='cd ../../../../../' | |
alias h='history' | |
alias path='echo -e ${PATH//:/\\n}' | |
alias bashrc='vim ~/.bashrc && source ~/.bashrc' | |
alias bashalias='vim ~/.bash_aliases && source ~/.bash_aliases' | |
alias run='mvn jetty:run' | |
alias open='nautilus .' | |
alias sopen='sudo nautilus .' | |
alias compress='tar -cvvf' | |
alias extract='tar -xvf' | |
#find file in a directory recursively | |
ff () { find "$1" -name "$2" -print; } | |
#find directory in a directory recursively | |
fd () { find "$1" -type d -name "$2" -print; } | |
alias sp='ps -ef | grep' | |
# Add an "alert" alias for long running commands. Use like so: | |
# sleep 10; alert | |
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment