Tips for customising your shell
When you first log into your VM, your profile will essentially be a clean slate. Below are some tips to get your bash profile off the ground.
~/.vimrc
Create the ~/.vimrc file and add the following lines to it:
set nocompatible
set belloff=all
set backspace=indent,eol,start
Terminal Colors
Uncomment line 46 in your ~/.bashrc file:
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
Should look like:
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
Optimise history search
As it stands, using the up arrow and down arrow keys will cycle through the latest commands in your history:
You can optomise your search history to return commands using a string as a REGEX pattern - see the example below cycling through old commands that begin with wc:
Create the
~/.inputrcfile and include the contents:
#Page up/page down "\e[A": history-search-backward "\e[B": history-search-forward $include /etc/inputrc
Include the following in your
~/.bashrcfile:
## advanced history search export INPUTRC=$HOME/.inputrc
Source both your
~/.bashrcand~/.inputrcfile:
source ~/.bashrc bind -f ~/.inputrc
Aliases
Shortcut commands are useful, particularly for tricky commands like tar. Save them as aliases.
Add the following to your ~/.bashrc file:
alias l="ls -lhg --color=auto"
alias la="ls -la --color=auto"
alias lt="ls -lcth --color=auto"
alias ls='ls --color=auto'
alias tarzip="tar -cvzf"
alias tarunzip="tar -xvzf"
alias grep="grep --color=auto"
alias vbrc="vi ~/.bashrc"
alias sbrc="source ~/.bashrc"