BASH 26
Bashrc extended By micha on 20th September 2018 11:39:40 AM
  1. force_color_prompt=yes
  2.  
  3. if [ -n "$force_color_prompt" ]; then
  4.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  5.         # We have color support; assume it's compliant with Ecma-48
  6.         # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  7.         # a case would tend to support setf rather than setaf.)
  8.         color_prompt=yes
  9.     else
  10.         color_prompt=
  11.     fi
  12. fi
  13.  
  14. if [ "$color_prompt" = yes ]; then
  15.     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35m\]\u\[\033[01;30m\]@\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '
  16. else
  17.     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  18. fi
  19.  
  20. # enable color support of ls and also add handy aliases
  21. if [ -x /usr/bin/dircolors ]; then
  22.     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  23.     alias ls='ls --color=auto'
  24.     #alias dir='dir --color=auto'
  25.     #alias vdir='vdir --color=auto'
  26.  
  27.     #alias grep='grep --color=auto'
  28.     #alias fgrep='fgrep --color=auto'
  29.     #alias egrep='egrep --color=auto'
  30. fi
  31.  
  32. # colored GCC warnings and errors
  33. #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
  34.  
  35. # some more ls aliases
  36. alias ll='ls -l'
  37. #alias la='ls -A'
  38. #alias l='ls -CF'
  39.  
  40.  
  41. status() {
  42.  echo -e "\nMachine information:" ; uname -a
  43.  echo -e "\nUsers logged on:" ; w -h
  44.  echo -e "\nCurrent date :" ; date
  45.  echo -e "\nMachine status :" ; uptime
  46.  echo -e "\nMemory status :" ; free -m
  47.  echo -e "\nFilesystem status :"; df -h
  48. }
  49.  
  50. extract ()
  51. {
  52.  if [ -f $1 ] ; then
  53.  case $1 in
  54.  *.tar.bz2) tar xjf $1 ;;
  55.  *.tar.gz) tar xzf $1 ;;
  56.  *.bz2) bunzip2 $1 ;;
  57.  *.rar) rar x $1 ;;
  58.  *.gz) gunzip $1 ;;
  59.  *.tar) tar xf $1 ;;
  60.  *.tbz2) tar xjf $1 ;;
  61.  *.tgz) tar xzf $1 ;;
  62.  *.zip) unzip $1 ;;
  63.  *.Z) uncompress $1;;
  64.  *.7z) 7z x $1 ;;
  65.  *) echo "'$1' cannot be extracted via ex()" ;;
  66.  esac
  67.  else
  68.  echo "'$1' is not a valid file"
  69.  fi
  70. }

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.