|
| 1 | +# don't put duplicate lines or lines starting with space in the history. |
| 2 | +# See bash(1) for more options |
| 3 | +HISTCONTROL=ignoreboth |
| 4 | + |
| 5 | +# append to the history file, don't overwrite it |
| 6 | +shopt -s histappend |
| 7 | + |
| 8 | +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) |
| 9 | +HISTSIZE=1000 |
| 10 | +HISTFILESIZE=2000 |
| 11 | + |
| 12 | +# check the window size after each command and, if necessary, |
| 13 | +# update the values of LINES and COLUMNS. |
| 14 | +shopt -s checkwinsize |
| 15 | + |
| 16 | +# set variable identifying the chroot you work in (used in the prompt below) |
| 17 | +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then |
| 18 | + debian_chroot=$(cat /etc/debian_chroot) |
| 19 | +fi |
| 20 | + |
| 21 | +# set a fancy prompt (non-color, unless we know we "want" color) |
| 22 | +case "$TERM" in |
| 23 | + xterm-color|*-256color) color_prompt=yes;; |
| 24 | +esac |
| 25 | + |
| 26 | +if [ -n "$force_color_prompt" ]; then |
| 27 | + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then |
| 28 | +color_prompt=yes |
| 29 | + else |
| 30 | +color_prompt= |
| 31 | + fi |
| 32 | +fi |
| 33 | + |
| 34 | +if [ "$color_prompt" = yes ]; then |
| 35 | + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
| 36 | +else |
| 37 | + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' |
| 38 | +fi |
| 39 | +unset color_prompt force_color_prompt |
| 40 | + |
| 41 | +# If this is an xterm set the title to user@host:dir |
| 42 | +case "$TERM" in |
| 43 | +xterm*|rxvt*) |
| 44 | + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" |
| 45 | + ;; |
| 46 | +*) |
| 47 | + ;; |
| 48 | +esac |
| 49 | + |
| 50 | +# enable color support of ls and also add handy aliases |
| 51 | +if [ -x /usr/bin/dircolors ]; then |
| 52 | + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" |
| 53 | + alias ls='ls --color=auto' |
| 54 | + #alias dir='dir --color=auto' |
| 55 | + #alias vdir='vdir --color=auto' |
| 56 | + |
| 57 | + alias grep='grep --color=auto' |
| 58 | + alias fgrep='fgrep --color=auto' |
| 59 | + alias egrep='egrep --color=auto' |
| 60 | +fi |
| 61 | + |
| 62 | +alias ..='cd ..' |
| 63 | +alias ...='cd ../../../' |
| 64 | +alias ....='cd ../../../../' |
| 65 | +alias .....='cd ../../../../' |
| 66 | +alias .4='cd ../../../../' |
| 67 | +alias .5='cd ../../../../..' |
| 68 | + |
| 69 | +# some more ls aliases |
| 70 | +alias ll='ls -alF' |
| 71 | +alias la='ls -A' |
| 72 | +alias l='ls -CF' |
0 commit comments