You can personalize your NCAR high-performance computing environment by using the sample content below in your startup files – the files that create your interactive login shell. The examples provide alternative color schemes and set some commonly used aliases.
These examples also demonstrate how to define commands to be run for interactive sessions only and commands to be run for all new shells. This distinction can be important if you have some commands in your initialization files that would be disruptive for non-interactive connections, such as when using the scp command (which is not interactable and therefore will not benefit from module loads or aliases) or within a batch script.
If you use bash or ksh, edit your .profile file. If you use tcsh, edit your .tcshrc file. PBS jobs on NCAR systems initialize your job environment with those files, so do not confuse them with .bashrc and .login files, which have different purposes and are not always sourced at login time.)
Personalizing these files is optional; the information is provided in response to users' requests.
### Settings for interactive shells only if [[ $- == *i* ]]; then # My Personal Prompt #PS1="\u@\h:\w> " # Another Colorful Prompt PS1="\[\e[1;31;40m\]\u@\[\e[1;34;40m\]\H:\[\e[1;32;40m\]\w>\[\e[0m\] " export PS1 # Generic Aliases alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' alias h="history | grep " alias ls="ls --color" alias vi="vim" alias j='qstat' alias more='less' alias tail='tail ---disable-inotify -f' alias diffcolor='git diff --color=always --color-words' fi ### Settings for all shells export PATH=~/bin:$PATH export PBS_ACCOUNT=CHEYENNE_PROJECT_CODE export DAV_PROJECT=CASPER_PROJECT_CODE ### Source .bashrc file to make environment more consistent ### (optional - some users prefer this; e.g., conda users) if [[ -f ~/.bashrc ]]; then . ~/.bashrc fi
### Settings for interactive shells only tty > /dev/null if ( $status == 0 ) then # My Personal Prompt #set prompt = "%n@%m:%~" # Another Colorful Prompt set prompt = "%{\033[31;40m%}%n@%{\033[0m%}%{\033[1;34m%}%m:%{\033[0m%}%{\033[32;40m%}%~>%{\033[0m%} " # Generic Aliases alias rm 'rm -i' alias cp 'cp -i' alias mv 'mv -i' alias h "history | grep " alias ls "ls --color" alias vi "vim" alias j 'qstat' alias more 'less' alias diffcolor 'git diff --color=always --color-words' endif ### Settings for all shells setenv PATH ~/bin:$PATH setenv PBS_ACCOUNT CHEYENNE_PROJECT_CODE setenv DAV_PROJECT CASPER_PROJECT_CODE #