Posted By

xxtjaxx on 11/05/09


Tagged

bashrcloginshellusefull


Versions (?)

my bashrc


 / Published in: Bash
 

  1. # If not running interactively, don't do anything
  2. [ -z "$PS1" ] && return
  3.  
  4. # don't put duplicate lines in the history. See bash(1) for more options
  5. # don't overwrite GNU Midnight Commander's setting of `ignorespace'.
  6. export HISTCONTROL=ignoredups
  7. export HISTSIZE=100000
  8. # append to the history file, don't overwrite it
  9. shopt -s histappend
  10.  
  11. # check the window size after each command and, if necessary,
  12. # update the values of LINES and COLUMNS.
  13. shopt -s checkwinsize
  14.  
  15. # make less more friendly for non-text input files, see lesspipe(1)
  16. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  17.  
  18. # set variable identifying the chroot you work in (used in the prompt below)
  19. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  20. debian_chroot=$(cat /etc/debian_chroot)
  21. fi
  22.  
  23. # set a fancy prompt (non-color, unless we know we "want" color)
  24. case "$TERM" in
  25. xterm-color) color_prompt=yes;;
  26. esac
  27.  
  28. # uncomment for a colored prompt, if the terminal has the capability; turned
  29. # off by default to not distract the user: the focus in a terminal window
  30. # should be on the output of commands, not on the prompt
  31. force_color_prompt=yes
  32.  
  33. if [ -n "$force_color_prompt" ]; then
  34. if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  35. # We have color support; assume it's compliant with Ecma-48
  36. # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  37. # a case would tend to support setf rather than setaf.)
  38. color_prompt=yes
  39. else
  40. color_prompt=yes
  41. fi
  42. fi
  43.  
  44. if [ "$color_prompt" = yes ]; then
  45. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  46. else
  47. PS1='${debian_chroot:+($debian_chroot)}\$PS2\u@\h:\w\$ '
  48. fi
  49. #unset color_prompt force_color_prompt
  50.  
  51. # If this is an xterm set the title to user@host:dir
  52. case "$TERM" in
  53. xterm*|rxvt*)
  54. PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  55. ;;
  56. *)
  57. ;;
  58. esac
  59.  
  60. # enable programmable completion features (you don't need to enable
  61. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  62. # sources /etc/bash.bashrc).
  63. if [ -f /etc/bash_completion ]; then
  64. . /etc/bash_completion
  65. fi
  66.  
  67.  
  68. # enable color support of ls and also add handy aliases
  69. if [ -x /usr/bin/dircolors ]; then
  70. eval "`dircolors -b`"
  71. alias ls='ls --color=auto -CF'
  72. alias dir='dir --color=auto'
  73. alias vdir='vdir --color=auto'
  74. alias grep='grep --color=auto'
  75. alias fgrep='fgrep --color=auto'
  76. alias egrep='egrep --color=auto'
  77. fi
  78. alias l='ls -lh' #make it colored _but_ >long<
  79. alias lns='ln �s' #symlink creator
  80. alias lR='ls -R'
  81. alias lswc='ls -a | wc -l' #file count
  82. alias rmtmp='find *~ -delete 2>/dev/null; rm -rf build/;' #delete temporary files
  83. #alias cbuild='mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debugfull -DCMAKE_INSTALL_PREFIX=/usr .. && make && cd ..' #building something replaced by cbuild shellscript
  84. alias procc='ps axf -o pid,ni,pcpu,%mem,wchan,cmd ' #process list ps pid,ni,pri,pcpu,wchan:14,comm
  85. alias up='svn update'
  86. alias s='source ~/.bashrc'
  87. alias emacs='/usr/bin/emacs -nw'
  88. alias rmc='rm CMakeCache.txt'
  89. #exported global variables crucial!
  90. #export CMAKE_MODULE_PATH='/usr/share/cmake-2.6/Modules:/home/andreas/development/branch/usr/share/cmake-2.6/Modules'
  91. #export LD_LIBRARY_PATH='/usr/local/lib:/usr/lib:/lib:/home/andreas/development/branch/usr/lib'
  92. export PATH='/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/sbin:/home/andreas/bin'
  93. alias kde-devel='ssh -X kde-devel@localhost'
  94. export EDITOR=/usr/bin/emacs #editor global variable
  95. alias m='make'
  96. alias aptitude='sudo aptitude'
  97. alias ping_h='ping 192.168.178.1'
  98. alias buildpkg='dpkg-buildpackage -rfakeroot -kDA5CFDBA -S -D -tc -sa -sd -sgpg'
  99. alias upput='dput ~xxtjaxx '
  100. function build_amarok
  101. {
  102. if [ -d ./build ]; then
  103. rm -rf ./build/
  104. fi
  105. mkdir build
  106. cd build
  107. cmake -DCMAKE_INSTALL_PREFIX=/home/andreas/development/branch/usr/ -DCMAKE_BUILD_TYPE=debugfull .. && make && make install
  108.  
  109. }

Report this snippet  

You need to login to post a comment.