The .bashrc file

The .bashrc file is a hidden configuration file stored in your home directory. It allows you to customize your terminal. There are many things you can do with this file:
  • customize your command prompt
  • set environment variables
  • set command aliases
  • create a customized function
  • and more

Below is an example .bashrc file.
#This is a commented line.
#This is my favorite .bashrc file.
#--Emily Johnson


###########################
# user-defined aliases #
###########################

#gives color to different types of files
alias ls="ls --color"

#clears screen
alias c="clear"

#useful long-form ls
alias lss="ls -ltrah"

###########################
# other user preferences #
###########################

# several custom prompt examples
PS1="\[\e]0;\h \u \w\a\]\h \u$ "
# PS1="\u:\W$ "
# PS1="\[\e[0;32m\]Andrew\[\e[m\] \[\e[1;34m\]\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\] "
# and my personal favorite:
# PS1="\[\033[0;31m\][\[\033[1;31m\]\u\[\033[0;33m\]@\[\033[0;32m\]\h\[\033[0;34m\]] \[\033[1;35m\]\w \[\033[0;32m\]~'~\[\033[0;35m\]@\[\033[0m\] "

#sets the editor for the SVN repository to vim. Other common choices: emacs, gedit, nano
export SVN_EDITOR=vim

###########################
# system-specific portion #
###########################

#changes the color-coding used by ls --color to my own preferences
eval `dircolors /home/john2105/.dir_colors`

#instructs the interpreter to look in my home directory for
#the newer Adobe Reader
PATH=$PATH:.:/home/john2105/adobe/Adobe/Reader9/bin
export PATH

export TMOUT=0

-- ForrestPhillips - 19 Oct 2017
Topic revision: r1 - 19 Oct 2017, ForrestPhillips
 

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback