Inhalt überspringen

Juli 8, 2010

[linux] meine .bashrc

 

Nur kurz damit ich das mal irgendwo liegen habe:

Prompt

if [ "$USER" == "root" ]; then
    PS1='\n\[\033[01;31m\][\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\W\[\033[01;31m\]]#\[\033[00m\] '
else
    PS1='\n\[\033[01;37m\][\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\W\[\033[01;37m\]]\$\[\033[00m\] '
fi

 

Aliase

alias l='ls -lAh --color'
alias g='grep -i --color'
alias lg='l | g'
alias gf='grep -nriH'
alias vg='grep -iv'
alias cd..='cd ..'
alias ...='cd ../../'
alias ..='cd ..'
alias cdd='cd ~/Desktop'
alias p='pwd'
alias c='clear'
alias cc='cd ~; c; source .bashrc'
alias install='sudo aptitude install'
alias search='aptitude search'
alias update='sudo aptitude update'
alias upgrade='sudo aptitude full-upgrade'

 

Uncompress function

e() {    
      if [ -f "$1" ] ; then
              case "$1" in
                        *.tar.bz2) tar xvjf "$1"   ;;
                        *.tar.gz)  tar xvzf "$1"   ;;
                        *.bz2)     bunzip2 "$1"    ;;
                        *.rar)     unrar x "$1"    ;;
                        *.gz)      gunzip "$1"     ;;
                        *.tar)     tar xvf "$1"    ;;
                        *.tbz2)    tar xvjf "$1"   ;;
                        *.tgz)     tar xvzf "$1"   ;;
                        *.zip)     unzip "$1"      ;;
                        *.Z)       uncompress "$1" ;;
                        *.7z)      7z x "$1"       ;;
                        *)
                                   echo "'$1' cannot be extracted"
                                   return 1
                        ;;
              esac
      else
              echo "'$1' is not a valid file"
              return 1
      fi
      return 0
}

 

Umgebungs-Variablen

export EDITOR="/usr/bin/vim"
export MC_COLOR_TABLE="$MC_COLOR_TABLE: editnormal=lightgray,black: editbold=yellow,black: editmarked=black,cyan"

 

Sonstiges

# Keine Doppelten Zeilen in die History aufnehmen
export HISTCONTROL=ignoredups

# ... und aufeinanderfolgende Einträge ignorieren
export HISTCONTROL=ignoreboth
Mehr aus Linux

Kommentar verfassen.

(required)
(required)

Hinweis: HTML ist erlaubt. Deine E-Mailadresse wird nicht veröffentlicht.

Kommentare abbonieren