Overview

HTTPS SSH

mybashrc

Installation

Install the 3 files

hg clone https://bitbucket.org/alwassoc/mybashrc
cd mybashrc
cp .mybash* ~

Add this to the end of your ~/.bashrc

if [ -e $HOME/.mybashrc ]; then
    source $HOME/.mybashrc
fi

Relog. You can delete the mybashrc dir you made in step 1 now if you want.

Important Aliases (many defined are not listed here)

For the full alias list check out .mybashaliases

  • mybashrc edit ~/.mybashrc
  • myaliases edit ~/.mybashaliases
  • myvimrc - edit ~/.vimrc
  • reload - reload mybashrc
  • ff - findfile function

Functions

Functions defined in .mybashrclib

  • _path - change the path (dir exists, no dupes) : export PATH=$(_path "/path/to/add" "$PATH")
  • xtitle - change the xterm title bar : xtitle "$(pwd)"
  • cleanup - unset vars provided : unset 'MYVAR1' 'MYVAR2'
  • have - returns true if file exists in the path : if have less; then echo 'less installed'; fi
  • exists - returns true if file exists : if exists /home/user; then echo 'yes'; fi
  • killproc - kill -9 processes by name : killproc firefox
  • extract - extract files from most known archive formats : extract file.tar.bz2
  • foreach - do something to all things on stdin : echo 1 2 3 | foreach echo 'an item'
  • repeat - repeat command x times : repeat 3 echo 'test'
  • findfile - find a file matching a pattern : findfile .py
  • swap - swap two files : swap file1 file2

Environment Vars

  • is_linux - true if running a linux kernel
  • is_arch - true if running arch linux
  • is_ubuntu - true if running ubuntu linux
  • is_debian - true if running debian linux
  • is_xwin - true if your terminal is running under xwindows
  • is_root - true if running as root