BASH Modification

From Indie IT Wiki
Jump to: navigation, search

HOWTO: MODIFY:

Aliases

Open a terminal and edit the .bashrc file:

nano ~/.bashrc

Edit or add the following lines:

alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias get='get_iplayer/get_iplayer'
alias grep='grep --color=auto'
alias hg='history |grep'
alias install='sudo aptitude -v install'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -lah'
alias ls='ls --color=auto'
alias myip='curl ifconfig.me'
alias ping='ping -c3 -n -i 0.2 -W1'
alias pingg='ping www.google.co.uk'
alias pingp='ping www.paully.co.uk'
alias pingm='ping 10.0.0.1'
alias pings='ping 192.168.0.1'
alias rav='rsync -a -v'
alias remove='sudo apt-get autoremove'
alias rm='rm -iv'
alias search='sudo apt-cache search'
alias ss='gksudo software-properties-gtk'
alias sshg='ssh username@server1.indie-it.com'
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
alias uu='sudo apt-get update && sudo apt-get upgrade'
alias uuf='sudo apt-get update && sudo apt-get dist-upgrade'

Reload the file:

source ~/.bashrc

To confirm the entries:

alias

Title of X Terminals

Add the following lines in your .bashrc file:

nano ~/.bashrc

# Change the window title of X terminals 
case $TERM in
        xterm*|rxvt*|Eterm)
                PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
                ;;
        screen)
                PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
                ;;
esac