TheChetan

~/.bash_profile

Sep 12th, 2017 (edited)
1,062
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.80 KB | None | 0 0
  1. # bash_profile
  2. export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
  3. export CLICOLOR=1
  4. export LSCOLORS=ExFxBxDxCxegedabagacad
  5. source ~/.bashrc
  6. set -o vi
  7. if [ -f ~/.git-completion.bash ]; then
  8.   . ~/.git-completion.bash
  9. fi
  10. export LC_ALL=en_US.UTF-8
  11. export LANG=en_US.UTF-8
  12.  
  13. # bashrc
  14. alias cls='printf "\33c\e[3J"'
  15. export HISTCONTROL=ignoreboth:erasedups
  16. shopt -s histappend
  17. export HISTSIZE=10000
  18. PROMPT_COMMAND="history -a ;history -c; history -n; history -r; $PROMPT_COMMAND"
  19. alias ipython='ipython --TerminalInteractiveShell.editing_mode=vi'
  20.  
  21. function extract()      # Handy Extract Program
  22. {
  23.     if [ -f $1 ] ; then
  24.         case $1 in
  25.             *.tar.bz2)   tar xvjf $1     ;;
  26.             *.tar.gz)    tar xvzf $1     ;;
  27.             *.bz2)       bunzip2 $1      ;;
  28.             *.rar)       unrar x $1      ;;
  29.             *.gz)        gunzip $1       ;;
  30.             *.tar)       tar xvf $1      ;;
  31.             *.tbz2)      tar xvjf $1     ;;
  32.             *.tgz)       tar xvzf $1     ;;
  33.             *.zip)       unzip $1        ;;
  34.             *.Z)         uncompress $1   ;;
  35.             *.7z)        7z x $1         ;;
  36.             *)           echo "'$1' cannot be extracted via >extract<" ;;
  37.         esac
  38.     else
  39.         echo "'$1' is not a valid file!"
  40.     fi
  41. }
  42.  
  43.  
  44. # Creates an archive (*.tar.gz) from given directory.
  45. function maketar() { tar cvzf "${1%%/}.tar.gz"  "${1%%/}/"; }
  46.  
  47. # Create a ZIP archive of a file or folder.
  48. function makezip() { zip -r "${1%%/}.zip" "$1" ; }
  49.  
  50. # Make your directories and files access rights sane.
  51. function sanitize() { chmod -R u=rwX,g=rX,o= "$@" ;}
  52. function my_ip() # Get IP adress on ethernet.
  53. {
  54.     MY_IP=$(/sbin/ifconfig eth0 | awk '/inet/ { print $2 } ' |
  55.       sed -e s/addr://)
  56.     echo ${MY_IP:-"Not connected"}
  57. }
Add Comment
Please, Sign In to add comment