1 # ~/.bashrc: executed by bash(1) for non-login shells.
2 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
5 # If not running interactively, don't do anything
6 [ -z "$PS1" ] && return
8 # don't put duplicate lines in the history. See bash(1) for more options
9 export HISTCONTROL=ignoredups
10 # ... and ignore same sucessive entries.
11 export HISTCONTROL=ignoreboth
13 # check the window size after each command and, if necessary,
14 # update the values of LINES and COLUMNS.
17 # make less more friendly for non-text input files, see lesspipe(1)
18 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
20 # set variable identifying the chroot you work in (used in the prompt below)
21 if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
22 debian_chroot=$(cat /etc/debian_chroot)
25 # set a fancy prompt (non-color, unless we know we "want" color)
27 xterm-color) color_prompt=yes;;
30 # uncomment for a colored prompt, if the terminal has the capability; turned
31 # off by default to not distract the user: the focus in a terminal window
32 # should be on the output of commands, not on the prompt
33 #force_color_prompt=yes
35 if [ -n "$force_color_prompt" ]; then
36 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
37 # We have color support; assume it's compliant with Ecma-48
38 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
39 # a case would tend to support setf rather than setaf.)
46 if [ "$color_prompt" = yes ]; then
47 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
49 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
51 unset color_prompt force_color_prompt
53 # If this is an xterm set the title to user@host:dir
56 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
63 # You may want to put all your additions into a separate file like
64 # ~/.bash_aliases, instead of adding them here directly.
65 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
67 #if [ -f ~/.bash_aliases ]; then
71 # enable color support of ls and also add handy aliases
72 if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
74 alias ls='ls --color=auto'
75 #alias dir='ls --color=auto --format=vertical'
76 #alias vdir='ls --color=auto --format=long'
78 #alias grep='grep --color=auto'
79 #alias fgrep='fgrep --color=auto'
80 #alias egrep='egrep --color=auto'
83 # some more ls aliases
88 # enable programmable completion features (you don't need to enable
89 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
90 # sources /etc/bash.bashrc).
91 if [ -f /etc/bash_completion ]; then
92 . /etc/bash_completion
95 umask 022 # create new file with '644'
96 ulimit -c 0 # no dump core
98 export LESS='-X -i -P ?f%f:(stdin). ?lb%lb?L/%L.. [?eEOF:?pb%pb\%..]'
103 set -o notify # notify end of background job immediately
105 shopt -s histappend # append command history instead of overwrite
106 shopt -s checkhash # check always PATH hash table
107 shopt -s cmdhist # save multi lines command to one line
108 shopt -s no_empty_cmd_completion # no complementation with no input
109 shopt -s histverify # check command history before execute
112 # view last 30 history or search from last 1000 history
114 if [ "$1" ]; then history 1000 | grep "$@"; else history 30; fi
117 # view last 30 history or search from all history
119 if [ "$1" ]; then history | grep "$@"; else history 30; fi
123 alias sudo='sudo -H '