Skip to content

Instantly share code, notes, and snippets.

@Romanmir
Created March 13, 2015 16:23
Show Gist options
  • Save Romanmir/d1171010ffbd7e2b283a to your computer and use it in GitHub Desktop.
Save Romanmir/d1171010ffbd7e2b283a to your computer and use it in GitHub Desktop.
interesting Bashrc options
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=erasedups
HISTIGNORE="ls:exit"
export HISTTIMEFORMAT="%d/%m/%y %T "
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
Interesting Bash Aliases:
# User specific aliases and functions
HISTCONTROL=erasedups
# Directories in color
export LS_OPTIONS=--color=auto
alias ls='ls $LS_OPTIONS'
alias ls='ls $LS_OPTIONS'
alias ll='ls -l'
alias d='ls $LS_OPTIONS -atrlp "$@"'
alias l='ls $LS_OPTIONS -la "$@"'
alias la='ls -A'
alias dir='ls $LS_OPTIONS --format=vertical'
alias vdir='ls $LS_OPTIONS --format=long'
# Apt comands
alias acs='apt-cache search'
alias agu='sudo apt-get update'
alias agg='sudo apt-get upgrade'
alias agd='sudo apt-get dist-upgrade'
alias agi='sudo apt-get install'
alias agr='sudo apt-get remove'
alias agar='sudo apt-get autoremove'
#aliases to save typing
alias du='du -h' # human-readable sizes
alias df='df -h' # ditto
alias rma='rm -Rf'
alias eject='eject cdrom'
alias whois='whois -H' # get rid of some crap text
alias psf='ps aux | grep '
alias h='history | grep '
alias nsl='netstat -alnp --protocol=inet | grep -v CLOSE_WAIT | cut -c-6,21-94 | tail +2'
alias dusk='du -s -k -c * | sort -rn'
alias dtop='watch ls -l'
#alias pskill='while a=`psf $1 |awk \'{ print $2 }\'`; do kill -15 $a; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment