# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything: [ -z "$PS1" ] && return # don't put duplicate lines in the history. See bash(1) for more options export HISTCONTROL=ignoredups export EDITOR="vim" PATH=$PATH:/sbin:/usr/sbin for DIR in \ /usr/X11/bin \ /usr/bin/X11 \ /usr/games \ /usr/local/games \ /usr/local/games/bin \ ${HOME}/bin \ ; do test -d $DIR && PATH="$PATH:$DIR" done export PATH nc -z wwwcache 3128 &> /dev/null if [ $? == 0 ]; then export http_proxy="http://wwwcache:3128" export ftp_proxy="http://wwwcache:3128" export RSYNC_PROXY="wwwcache:3128" export no_proxy="localhost,127.0.0.1,.int.stewarts.org.uk" fi # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # enable color support of ls and also add handy aliases if [ "$TERM" != "dumb" ]; then eval "`dircolors -b`" alias ls='ls --color=auto -F -h ' alias dir='ls --color=auto --format=vertical' alias vdir='ls --color=auto --format=long' else alias ls='ls -F -h ' fi # some more aliases alias l='ls' alias ll='ls -l' alias la='ls -a' alias lla='ls -l -a' alias lart='ls -l -a -r -t' alias df='df -h' alias '..'='cd ..' alias '...'='cd ../..' alias '....'='cd ../../..' alias '.....'='cd ../../../..' alias h=history alias hg='h | grep' alias c=clear alias j="jobs -l" alias apt='sudo aptitude' alias auu="sudo aptitude update && sudo aptitude upgrade && sudo aptitude clean" eval `lesspipe` psa() { ps axwwf --sort pid -o pid,ppid,nlwp,user,nice,%cpu,%mem,vsz,rss,tty,stat,start,bsdtime,command \ | egrep -i "^ PID|$1" | grep -v grep } alias xterm='xterm -fg gray -bg black' alias rdp='rdesktop -k en-gb -g 1024x768+0+0 -N -a 16 -z -x l ' alias gvi=gvim alias mkiso='mkisofs -R -r -l -J ' if [ -d /proc/ide ]; then cdrom=`grep ide-cdrom /proc/ide/hd?/driver | awk -F'/' '{print $4}'` alias burniso='cdrecord -v -eject -pad speed=16 dev=/dev/$cdrom driveropts=burnfree gracetime=2 ' alias blankcd='cdrecord -v -eject -pad speed=16 dev=/dev/$cdrom driveropts=burnfree gracetime=2 blank=fast' burnfile() { mkiso "$*" | burniso - ; } fi # set variable identifying the chroot you work in (used in the prompt below) if [ -z "$debian_chroot" -a -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi no_colour="\[\e[0m\]" black="\[\e[0;30m\]" darkred="\[\e[0;31m\]" darkgreen="\[\e[0;32m\]" darkyellow="\[\e[0;33m\]" darkblue="\[\e[0;34m\]" darkpurple="\[\e[0;35m\]" darkcyan="\[\e[0;36m\]" gray="\[\e[0;37m\]" darkgray="\[\e[1;30m\]" red="\[\e[1;31m\]" green="\[\e[1;32m\]" yellow="\[\e[1;33m\]" blue="\[\e[1;34m\]" purple="\[\e[1;35m\]" cyan="\[\e[1;36m\]" white="\[\e[1;37m\]" username="${darkyellow}\u${no_colour}" at="${black}@${no_colour}" hostname="${darkgreen}\h${no_colour}" workingdir="${darkcyan}\w${no_colour}" nojobs="${darkgreen}\${jl}${no_colour}" laststatus="${red}\`if [ \$? = "0" ]; then echo ''; else echo \"(\$?)\"; true; fi\`${no_colour}" history="${darkred}\!${no_colour}" prompt="${darkgreen}\\$" dateandtime="${darkbrown}\$(date +'%H:%M %a %d/%m/%Y')${no_colour}" smileface=" \|/ ____ \|/\n ~@-/ oO \-@~\n /_( \__/ )_\ \n \__U_/\n" # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm-color|xterm) export PROMPT_COMMAND='export jl=""; test $(jobs | wc -l) -gt 0 && jl="($(jobs|wc -l))"' #PS1='\u@\h:\w\$ ' PS1="${username}${at}${hostname} ${workingdir} ${nojobs}${laststatus}${history}${prompt}${no_colour} " ;; *) PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' ;; esac # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*|gnome*|konsole*) long_title='\u@\h:\w' long_title='\W' short_title='\W' titlebar="\[\033]0;$short_title\007\033]2;$long_title\007\]" ;; *) titlebar="" ;; esac export PS1="${titlebar}$PS1" # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profiles # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi