Avatar
Fernando Vásquez is an electronics engineer and software developer currently based in the world. He occasionally blogs about Python and Android programming.

My .bashrc Configuration

My .bashrc Configuration

bashrc vs bash_profile

  • /etc/profile executes when any user starts session
  • /etc/bashrc executes when any user runs bash
  • ~/.bash_profile executes when specific user starts session.
  • ~/.bashrc executes when specific user runs bash

  • My personal .bashrc file:
# Command line history size and file
export HISTCONTROL=ignoreboth
export HISTSIZE=100000
export HISTFILESIZE=100000
export HISTIGNORE="pwd:history"

# aliases
alias ll="ls -lhpi"
alias la="ls -lhpia"

# colorful prompt
export PS1='\[\033[1;36m\]\u\[\033[0m\]@\[\033[1;95m\]\h\[\033[0m\] \[\033[1;33m\]\w\[\033[0m\] \[\033[1;31m\]\$\[\033[0m\] '

# as root /etc/profile
HOSTNAME='/bin/hostname'

# colors
LS_COLORS=$LS_COLORS:'di=1;36:'; export LS_COLORS
LS_COLORS=$LS_COLORS:'di=1;33:'; export LS_COLORS

Echo

echo -e “\e[1;31m This is red text \e[0m”

Code Colors

0   = default colour
1   = bold
4   = underlined
5   = flashing text
7   = reverse field
31  = red
32  = green
33  = orange
34  = blue
35  = purple
36  = cyan
37  = grey
40  = black background
41  = red background
42  = green background
43  = orange background
44  = blue background
45  = purple background
46  = cyan background
47  = grey background
90  = dark grey
91  = light red
92  = light green
93  = yellow
94  = light blue
95  = light purple
96  = turquoise
100 = dark grey background
101 = light red background
102 = light green background
103 = yellow background
104 = light blue background
105 = light purple background
106 = turquoise background

all tags