/etc/bash.bashrc


SUBMITTED BY: Guest

DATE: Jan. 8, 2015, 2:57 p.m.

FORMAT: Bash

SIZE: 4.4 kB

HITS: 781

  1. # System-wide .bashrc file for interactive bash(1) shells.
  2. # To enable the settings / commands in this file for login shells as well,
  3. # this file has to be sourced in /etc/profile.
  4. cd
  5. bind '"\e[A"':history-search-backward
  6. bind '"\e[B"':history-search-forward
  7. export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
  8. export HISTCONTROL=ignoreboth
  9. export HISTCONTROL=ignorespaces
  10. export HISTIGNORE=??
  11. shopt -s histappend
  12. shopt -s checkwinsize
  13. PROMPT_COMMAND='history -a'
  14. export EDITOR=vim
  15. eval "$(lesspipe)"
  16. setxkbmap -option keypad:pointerkeys
  17. # If not running interactively, don't do anything
  18. [ -z "$PS1" ] && return
  19. # check the window size after each command and, if necessary,
  20. # update the values of LINES and COLUMNS.
  21. shopt -s checkwinsize
  22. # set variable identifying the chroot you work in (used in the prompt below)
  23. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  24. debian_chroot=$(cat /etc/debian_chroot)
  25. fi
  26. # set a fancy prompt (non-color, overwrite the one in /etc/profile)
  27. #PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  28. use_color=false
  29. # Set colorful PS1 only on colorful terminals.
  30. # dircolors --print-database uses its own built-in database
  31. # instead of using /etc/DIR_COLORS. Try to use the external file
  32. # first to take advantage of user additions. Use internal bash
  33. # globbing instead of external grep binary.
  34. safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
  35. match_lhs=""
  36. [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
  37. [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
  38. [[ -z ${match_lhs} ]] \
  39. && type -P dircolors >/dev/null \
  40. && match_lhs=$(dircolors --print-database)
  41. [[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
  42. if ${use_color} ; then
  43. # Enable colors for ls, etc. Prefer ~/.dir_colors #64489
  44. if type -P dircolors >/dev/null ; then
  45. if [[ -f ~/.dir_colors ]] ; then
  46. eval $(dircolors -b ~/.dir_colors)
  47. elif [[ -f /etc/DIR_COLORS ]] ; then
  48. eval $(dircolors -b /etc/DIR_COLORS)
  49. fi
  50. fi
  51. if [[ ${EUID} == 0 ]] ; then
  52. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
  53. else
  54. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
  55. fi
  56. alias ls='ls --color=auto'
  57. alias grep='grep --colour=auto'
  58. else
  59. if [[ ${EUID} == 0 ]] ; then
  60. # show root@ when we don't have colors
  61. PS1='\u@\h \W \$ '
  62. else
  63. PS1='\u@\h \w \$ '
  64. fi
  65. fi
  66. # Try to keep environment pollution down, EPA loves us.
  67. unset use_color safe_term match_lhs
  68. # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
  69. # If this is an xterm set the title to user@host:dir
  70. #case "$TERM" in
  71. #xterm*|rxvt*)
  72. # PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
  73. # ;;
  74. #*)
  75. # ;;
  76. #esac
  77. # enable bash completion in interactive shells
  78. if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
  79. . /etc/bash_completion
  80. fi
  81. # sudo hint
  82. #if [ ! -e $HOME/.sudo_as_admin_successful ]; then
  83. # case " $(groups) " in *\ admin\ *)
  84. # if [ -x /usr/bin/sudo ]; then
  85. # cat <<-EOF
  86. # To run a command as administrator (user "root"), use "sudo <command>".
  87. # See "man sudo_root" for details.
  88. #
  89. # EOF
  90. # fi
  91. # esac
  92. #fi
  93. # if the command-not-found package is installed, use it
  94. if [ -x /usr/lib/command-not-found ]; then
  95. function command_not_found_handle {
  96. # check because c-n-f could've been removed in the meantime
  97. if [ -x /usr/lib/command-not-found ]; then
  98. /usr/bin/python /usr/lib/command-not-found -- $1
  99. return $?
  100. else
  101. return 127
  102. fi
  103. }
  104. fi
  105. . /etc/bash_aliases

comments powered by Disqus