######################################################################## # ~/.bashrc # # Notes: # # 1) Any text that follows a '#' in a file of bash commands (including # a bash script) is a comment, and is ignored by the bash interpreter # # 2) If you modify this file, you must type # # % source ~/.bashrc # # to have the changes take effect in the current shell. Also, # refer to the 'bash Startup Files' of the Linux / Unix notes at # http://bh0.phas.ubc.ca/210/Notes_unix.html#BASHSTARTUP # for a discussion of the recommended procedure to follow when # changing this file or ~/.profile ######################################################################## #----------------------------------------------------------------------- # Source global definitions as set up by the vendor/distributor and # possibly modified by the local system administrators. The file # /etc/bashrc is widely used by convention. #----------------------------------------------------------------------- if [ -f /etc/bashrc ]; then source /etc/bashrc fi #----------------------------------------------------------------------- # Control terminal characteristics (advanced topic!) #----------------------------------------------------------------------- if tty -s; then stty dec export TERM fi #----------------------------------------------------------------------- # Add (prepend) some components to the path, i.e. the colon-separated # list of directories/folders in which the OS is to look for commands # (a.k.a. executables). # # # . -> Current working directory. # ~/bin -> 'bin' directory in your home directory, convenient # and standard place to put your own executables # (scripts, programs, etc.) # ~phys210/bin -> 'bin' directory in phys210's home directory (course # account). From time to time, you will need/want # commands installed here. # # Note that $PATH evaluates to the current/previous value of the # path. #----------------------------------------------------------------------- #----------------------------------------------------------------------- # Add (prepend) some components to the path: note that $PATH evaluates # to the current (old) setting of the path, and that we include the # working directory (.) #----------------------------------------------------------------------- export PATH=.:~/bin:~phys210/bin:$PATH #----------------------------------------------------------------------- # Set the command prompt to include the hostname (\h), the username (\u), # and the last component (i.e. the basename) of the current working # directory (\W). See 'man bash' and search for 'PROMPTING' for more # information on configuring the prompt. # # If you want to restore the lab-default prompt which includes the *full* # path name, comment-out or delete the following line. #----------------------------------------------------------------------- PS1="[\u@\h \W]$ " #----------------------------------------------------------------------- # Set various shell options #----------------------------------------------------------------------- set -o noclobber # Do not let output redirection overwrite files. set -o ignoreeof # Disable ^D logout feature. #----------------------------------------------------------------------- # Control command-line history features #----------------------------------------------------------------------- export HISTFILESIZE=1000 # Save 1000 commands in the history export HISTCONTROL=ignoredups # Do no put duplicate lines in the history. #----------------------------------------------------------------------- # Source the ~/.aliases file assuming that it exists, to define aliases #----------------------------------------------------------------------- if [ -f ~/.aliases ]; then source ~/.aliases fi #----------------------------------------------------------------------- # Disable coredumps (advanced topic!) #----------------------------------------------------------------------- ulimit -S -c 0 #----------------------------------------------------------------------- # This disables a feature which causes the shell to take a long time # to determine that a command you have typed is not found #----------------------------------------------------------------------- unset command_not_found_handle #----------------------------------------------------------------------- # Set colors for ls #----------------------------------------------------------------------- export LS_COLORS='no=00:fi=00:di=01;34:ln=00;35:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=00;31:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jpg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.png=01;35:*.mpg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:' #----------------------------------------------------------------------- # Set default permissions for file creation #----------------------------------------------------------------------- umask 022