Posted By

orleyhuxwell on 11/04/13


Tagged


Versions (?)

config-bash


 / Published in: Bash
 

Example bash configuration

  1. #!/bin/bash
  2.  
  3. # !! Important
  4. # Export before sourcing this file PS_COLOR variable
  5.  
  6. #--- Options
  7. # Don't wait for job termination notification
  8. set -o notify
  9. # Don't use ^D to exit
  10. set -o ignoreeof
  11. # Use case-insensitive filename globbing
  12. shopt -s nocaseglob
  13. # Make bash append rather than overwrite the history on disk
  14. shopt -s histappend
  15. # When changing directory small typos can be ignored by bash
  16. # for example, cd /vr/lgo/apache would find /var/log/apache
  17. shopt -s cdspell
  18. # Check the window size after each command and, if necessary,
  19. # update the values of LINES and COLUMNS.
  20. shopt -s checkwinsize
  21. # Append to the history file, don't overwrite it
  22. shopt -s histappend
  23. # If set, the pattern "**" used in a pathname expansion context will
  24. # match all files and zero or more directories and subdirectories.
  25. shopt -s globstar
  26.  
  27. #--- Exports
  28. # Don't put duplicate lines in the history
  29. export HISTCONTROL="ignoredups:erasedups:ignorespace"
  30. # Ignore some controlling instructions
  31. export HISTIGNORE="[ ]*:&:bg:fg:exit"
  32. # Whenever displaying the prompt, write the previous line to disk
  33. export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
  34. export HISTSIZE=100000
  35. export HISTFILESIZE=100000
  36. export PS1="\[\e]0;\w\a\]\n\[\e[34m\]\u@\h \[\e[33m\]\t \w\[\e[0m\]\n\$ "
  37.  
  38. #--- Aliases
  39. alias df='df -h'
  40. alias du='du -h --max-depth=1'
  41. alias grep='grep --color'
  42. alias ll='ls -lh --color=auto'
  43. alias la='ls -lah --color=auto'
  44.  
  45. alias m-install='mvn clean install'
  46.  
  47. alias ga='git add'
  48. alias gc='git status -s -uno; git commit -a -m "Archiving"'

Report this snippet  

You need to login to post a comment.