Posted By

willcodeforfood on 12/16/07


Tagged

bashrc


Versions (?)

bash profile 3


 / Published in: Bash
 

  1. # rezza's .bashrc
  2. # Most recent update: Sat 03 Jun 2006 12:31:58 BST
  3.  
  4. [ -z "$PS1" ] && return
  5.  
  6. # Basic options
  7. export HISTCONTROL=ignoredups
  8. export COLORFGBG='default;default'
  9.  
  10. shopt -s checkwinsize
  11. eval "$(dircolors -b /etc/dircolors)"
  12.  
  13. # Aliases
  14. alias ls='ls -h --color=auto'
  15. alias ll='ls -l'
  16. alias la='ls -A'
  17. alias l='ls -CF'
  18. alias svim='sudo vim'
  19. alias h='cd'
  20. alias ..='cd ..'
  21. alias cd..='cd ..'
  22. alias ...='cd ../..'
  23. alias cim='vim'
  24. alias back='cd $OLDPWD'
  25. alias root='sudo su'
  26. alias runlevel='sudo /sbin/init'
  27. alias grep='grep --color=auto'
  28. alias omg='ssh alpha.hostingbeyond.co.uk'
  29. alias oszen='ssh os-zen.net'
  30. alias data='ssh neit.datasysinte.info'
  31. alias dfh='df -h'
  32. alias gvim='gvim -geom 84x26'
  33. alias update='sudo pacman -Syu'
  34. alias mpdupdate='aurbuild -b mpd-svn mpc-svn libmpd-svn gmpc-svn'
  35. alias start='dbus-launch startx'
  36.  
  37. # Prompt
  38. PS1='[33[0;34m]([33[0;31m]w[33[0;34m]) [33[00m]h [33[0;31m]$ [33[00m]'
  39.  
  40. # Paths
  41. PATH=$PATH:${HOME}/bin:/usr/lib/wine/bin:/sbin:/usr/sbin
  42. export PATH=$PATH:/usr/local/bin
  43. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/wine/lib:/usr/local/lib
  44. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
  45.  
  46. # X Terminal titles
  47. case "$TERM" in
  48. xterm*|rxvt*)
  49. PROMPT_COMMAND='echo -ne "33]0;${USER}@${HOSTNAME}: ${PWD}07"'
  50. ;;
  51. *)
  52. ;;
  53. esac
  54.  
  55. # Functions
  56. extract () {
  57. if [ -f $1 ] ; then
  58. case $1 in
  59. *.tar.bz2) tar xjf $1 ;;
  60. *.tar.gz) tar xzf $1 ;;
  61. *.bz2) bunzip2 $1 ;;
  62. *.rar) rar x $1 ;;
  63. *.gz) gunzip $1 ;;
  64. *.tar) tar xf $1 ;;
  65. *.tbz2) tar xjf $1 ;;
  66. *.tgz) tar xzf $1 ;;
  67. *.zip) unzip $1 ;;
  68. *.Z) uncompress $1 ;;
  69. *) echo "'$1' cannot be extracted via extract()" ;;
  70. esac
  71. else
  72. echo "'$1' is not a valid file"
  73. fi
  74. }
  75. ziprm () {
  76. if [ -f $1 ] ; then
  77. unzip $1
  78. rm $1
  79. else
  80. echo "Need a valid zipfile"
  81. fi
  82. }
  83. psgrep() {
  84. if [ ! -z $1 ] ; then
  85. echo "Grepping for processes matching $1..."
  86. ps aux | grep $1 | grep -v grep
  87. else
  88. echo "!! Need name to grep for"
  89. fi
  90. }
  91. grab() {
  92. sudo chown -R ${USER} ${1:-.}
  93. }
  94.  
  95. # Coloured Pacman searching
  96. pacs () {
  97. echo -e "$(pacman -Ss $@ | sed
  98. -e 's#current/.*#\033[1;31m&\033[0;37m#g'
  99. -e 's#extra/.*#\033[0;32m&\033[0;37m#g'
  100. -e 's#community/.*#\033[1;35m&\033[0;37m#g'
  101. -e 's#^.*/.* [0-9].*#\033[0;36m&\033[0;37m#g' )"
  102. }
  103.  
  104. # Bash completion
  105. if [ -f /etc/bash_completion ]; then
  106. . /etc/bash_completion
  107. fi
  108.  
  109. # Locale and editor
  110. export EDITOR=vim
  111. export BROWSER="epiphany '%s' &"

Report this snippet  

You need to login to post a comment.