Skip to content

Instantly share code, notes, and snippets.

@abhishekmurthy
Last active January 26, 2016 09:09
Show Gist options
  • Save abhishekmurthy/4546177 to your computer and use it in GitHub Desktop.
Save abhishekmurthy/4546177 to your computer and use it in GitHub Desktop.
Custom bashrc
# my custom .bashrc scripts
# mkcd -- makes life simpler
function mkcd() {
mkdir $1;
cd $1;
}
## a quick way to get out of current directory ##
alias ..="cd ..";
alias get="sudo apt-get";
alias reboot="sudo reboot";
## Show hidden files ##
alias l.='ls -d .* --color=auto'
## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgAnonymousrep --color=auto'
alias bc='bc -l'
alias mkdir='mkdir -pv'
# install colordiff package :)
alias diff='colordiff'
alias mount='mount |column -t'
alias h='history'
alias j='jobs -l'
alias path='echo -e ${PATH//:/\\n}'
alias now='date +"%T'
alias nowtime=now
alias nowdate='date +"%d-%m-%Y"'
alias vi=vim
alias svi='sudo vi'
alias vis='vim "+set si"'
alias edit='vim'
# Stop after sending count ECHO_REQUEST packets #
alias ping='ping -c 5'
# Do not wait interval 1 second, go fast #
alias fastping='ping -c 100 -s.2'
alias ports='netstat -tulanp'
# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'
# confirmation #
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
# update on one command
alias update='sudo apt-get update && sudo apt-get upgrade'
# become root #
alias root='sudo -i'
alias su='sudo -i'
# reboot / halt / poweroff
alias reboot='sudo /sbin/reboot'
alias poweroff='sudo /sbin/poweroff'
alias halt='sudo /sbin/halt'
alias shutdown='sudo /sbin/shutdown'
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
## this one saved by butt so many times ##
alias wget='wget -c'
# top is atop, just like vi is vim
alias top='atop'
# Alias's to modified commands
alias ps='ps auxf'
alias home='cd ~'
alias pg='ps aux | grep' #requires an argument
alias un='tar -zxvf'
# Alias chmod commands
alias mx='chmod a+x'
alias 000='chmod 000'
alias 644='chmod 644'
alias 755='chmod 755'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment