bashrc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # .bashrc
  2. # Source global definitions
  3. if [ -f /etc/bashrc ]; then
  4. . /etc/bashrc
  5. fi
  6. configure_ecearth()
  7. {
  8. if [ `hostname` != "frontal1" ]; then
  9. echo "First, we move to frontal1..."
  10. touch .configure_ecearth
  11. ssh frontal1
  12. fi
  13. export EC_DEP=/projects/acad/ecearth/opt
  14. if [ -f $EC_DEP/modules.load ]; then
  15. source $EC_DEP/modules.load
  16. fi
  17. }
  18. # User specific aliases and functions
  19. if [ `hostname` = "frontal1" ]; then
  20. [[ -f .configure_ecearth ]] && configure_ecearth
  21. [[ -f .configure_ecearth ]] && rm .configure_ecearth
  22. fi
  23. # Path/variables
  24. # --------------
  25. export HOST=`uname -n`
  26. export HISTFILESIZE=6000
  27. export HISTSIZE=6000
  28. # Display
  29. # -------
  30. export PS1="\[\033[1;39m\]\u@\h\[\033[0;0m\] \t \[\033[0;34m\]\w \[\033[2;31m\]\# \[\033[0;0m\]> "
  31. # alias
  32. # -----
  33. if [ `uname` = "Linux" ] ; then
  34. alias df='df -hT'
  35. alias ls='ls --color -F'
  36. alias lo='ls -oh -F'
  37. alias cpa="cp -a"
  38. alias ps="ps --forest"
  39. else
  40. alias df='df -k'
  41. alias ls='ls -F'
  42. alias lo='ls -o -F'
  43. alias cpa="cp -rf"
  44. fi
  45. alias rm="rm -i"
  46. alias mv="mv -i"
  47. alias cp="cp -i"
  48. alias cd..="cd .."
  49. alias dc="cd"
  50. alias la='ls -a -o -F -l'
  51. alias sl='ls'
  52. alias l='ls -lh'
  53. alias ll='ls -o -F'
  54. alias lt='ls -l -s -t |more'
  55. alias m="less"
  56. alias h="history"
  57. # Personal modules variables
  58. # --------------------------
  59. if [ `hostname` = "frontal3" ]; then
  60. PATH="/projects/acad/ecearth/opt/apps/lua/lua/bin:$PATH"
  61. . /projects/acad/ecearth/opt/lmod/lmod/init/profile
  62. ulimit -u 8192
  63. export OMP_NUM_THREADS=2
  64. fi