Home > bash, debian, mac os > Common entries in .bash_aliases

Common entries in .bash_aliases

I keep my bash aliases grouped in separate files. I include them from .bashrc like this:

# Alias definitions that should work everywhere
if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases

# Alias definitions that are specific to your distro
# e.g. Cygwin-only stuff, apt-get shortcuts on Debian, etc.
if [ -f ~/.bash_aliases.distro-specific ]; then
    . ~/.bash_aliases.distro-specific

This is the ~/.bash_aliases that I commonly use:

# Interactive verbose operation...
alias rm='rm -iv'
alias cp='cp -iv'
alias mv='mv -iv'

# Default to human readable figures
alias df='df -h'
alias du='du -h'

# Misc :)
alias less='less -r'                          # raw control characters
alias whence='type -a'                        # where, of a sort
alias grep='grep --color'                     # show differences in colour
alias egrep='egrep --color=auto'              # show differences in colour
alias fgrep='fgrep --color=auto'              # show differences in colour

# Some shortcuts for different directory listings
alias ls='ls -hF --color=tty'                 # classify files in colour
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias ll='ls -l'                              # long list
alias la='ls -A'                              # all but . and ..
alias l='ls -CF'                              #

This is the ~/.bash_aliases.distro-specific that I use on Debian (or other APT-based distros):

alias show='apt-cache show'
alias search='apt-cache search'

alias files='dpkg -L'
alias selections='dpkg --get-selections'

alias install='sudo apt-get install'
alias reinstall='sudo apt-get install --reinstall'

alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'

alias remove='sudo apt-get remove'
alias purge='sudo apt-get remove --purge'
alias autoremove='sudo apt-get autoremove'
Categories: bash, debian, mac os
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: