# bash configuration file # # Balaji S. Srinivasan # This file can be found at http://jinome.stanford.edu/stat366/unix/.bashrc # Modification of several original files, including system default. # Prompt from http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html # PROMPT RELATED # Make bash check it's window size after a process completes shopt -s checkwinsize # by default, we want this to get set. # Even for non-interactive, non-login shells. if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then umask 002 else umask 022 fi # are we an interactive shell? if [ "$PS1" ]; then if [ -x /usr/bin/tput ]; then if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal stty erase `tput kbs` elif [ -x /usr/bin/wc ]; then if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal stty erase `tput kbs` fi fi fi case $TERM in xterm*) if [ -e /etc/sysconfig/bash-prompt-xterm ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm else PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' fi ;; screen) if [ -e /etc/sysconfig/bash-prompt-screen ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen else PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"' fi ;; *) [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default ;; esac # Turn on checkwinsize shopt -s checkwinsize #---------> Prompt edited here [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u \w]\\$ " if [ "x$SHLVL" != "x1" ]; then # We're not a login shell for i in /etc/profile.d/*.sh; do if [ -r "$i" ]; then . $i fi done fi fi # vim:ts=4:sw=4 #Nice Prompt w/ constant updating of home directory; much more available at this URL #http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html PS1="\[\033[0;34m\][\u:\w]$\[\033[0m\]" # ALIAS AND PATH PATH=/opt/local/bin:$PATH:~/bin #See below for a list of aliases (this is a heavily abbreviated list of my aliases; the main point is to get you to think about #defining 2-3 character shortcuts for your commonly used commands, which you usually want to do without #having to even hit shift. When you run hundreds of commands in a day, this really makes a different in #your productivity) #Prevent accidental overwriting of files by setting rm/mv/cp etc. to prompt before overwrite with -i = interaction option alias rm="rm -i" alias mv="mv -i" alias cp="cp -i" set -o noclobber #Enable color support of ls and handy aliases for directory manipulation alias ll="ls -alrtF --color" alias la="ls -A" alias l="ls -CF" alias dir='ls --color=auto --format=vertical' alias vdir='ls --color=auto --format=long' alias m='less' alias ..='cd ..' alias ...='cd ..;cd ..' alias md='mkdir' alias cl='clear' alias duhm='du -ch --max-depth=1' #Enable quickjump to common directories alias hom='cd /home/balajis' alias bal='cd ~' alias dl='cd ~/downloads' #Some shortcuts for commonly used commands alias ff='firefox' alias awk='gawk' alias bcl='bc -lqw'