Saturday, November 8, 2008

My Favorite Bash Settings


# source the system wide bashrc if it exists
if [ -e /etc/bash.bashrc ] ; then
  source /etc/bash.bashrc

# source the users bashrc if it exists
if [ -e "${HOME}/.bashrc" ] ; then
  source "${HOME}/.bashrc"

# Set PATH so it includes Android SDK Tools
if [ -d "/cygdrive/c/sdk/android-sdk-windows/tools" ] ; then

# Set Prompt to 'username@hostname:pwd\n'
export PS1="\[\e[0;33m\]\u\[\e[0m\]@\[\e[31m\]\h\[\e[39m\]:\w\n$ \[\e]2;\h:${PWD}\a\]"


# 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 color
alias grep='grep --color --exclude-dir=.svn'  # and exclude '.svn' folder
alias rm='rm -i'

# Some shortcuts for different directory listings
if [[ "$(uname)" = "Linux" ]]; then
  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'                              #

# Programs and Binaries shortcuts
alias emacs=/cygdrive/c/bin/emacs-23.2/bin/runemacs
alias firefox="cygstart /cygdrive/c/Program\ Files/Mozilla\ Firefox/firefox.exe"
alias mysql="cygstart /cygdrive/c/xampp/mysql/bin/mysql.exe"
alias mysqldump='/cygdrive/c/xampp/mysql/bin/mysqldump.exe'
alias php="/cygdrive/c/xampp/php/php.exe"
alias junction='/cygdrive/c/bin/junction.exe'

# Customized per workstation
alias xampp_start=/cygdrive/c/xampp/xampp_start.exe
alias xampp_stop=/cygdrive/c/xampp/xampp_stop.exe
alias xampp_restart=/cygdrive/c/xampp/xampp_restart.exe
alias todo="emacs ~/docs/secure/"

No comments:

Post a Comment