Shell and dotfiles¶
When you log in to any of our clusters via SSH, you are dropped into a Unix shell. This page covers which shells are available, how to change yours, and how to customize your environment with dotfiles.
Available shells¶
The default shell for new accounts is bash. We also support tcsh, and can provide access to alternatives such as zsh or ksh upon request.
Note
If your account was created before 2012, your default shell may be tcsh, as this was the previous default.
Changing your shell¶
You can change your default shell through the account setup server:
ssh username@account-setup.sw.ehu.es
The setup menu includes an option to select your preferred shell. The change takes effect on your next login.
Alternatively, you can contact us at support-hpc@dipc.org and we will change it for you.
Dotfiles¶
Dotfiles are configuration files that customize your shell environment. They are called "dotfiles" because their names start with a dot (.), which makes them hidden by default (ls -a to see them).
We do not populate your home directory with any default dotfiles. It is up to you to create and customize them as needed.
Dotfiles for bash¶
When you log in, bash reads these files in order:
~/.bash_profile: runs on login shells (e.g. when you SSH into the cluster). Use it for environment setup that only needs to happen once per session.~/.bashrc: runs on interactive non-login shells (e.g. when you open a new terminal inside a session). Use it for aliases, prompt customization, and shell options.
Tip
A common pattern is to put all your configuration in ~/.bashrc and have ~/.bash_profile simply source it:
# ~/.bash_profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
This way your settings are consistent regardless of how you open a shell.
Example ~/.bashrc¶
On Hyperion, we typically set up a custom prompt to make it easier to identify which node you are on:
export PS1="\[\033[35m\]\t\[\033[m\]-\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[31;1m\]\w\[\033[m\]$ "
This gives you a color-coded prompt showing the time, username, hostname, and current directory:
10:32:22-username@hyperion-008:~$
Beyond this, your ~/.bashrc is yours to customize. Some useful additions:
# Handy aliases
alias ll='ls -lh'
alias la='ls -lha'
alias q='squeue -u $USER'
alias quota='beegfs-ctl --getquota --uid $USER'
Dotfiles for tcsh¶
If you use tcsh, the equivalent files are:
~/.login: runs on login shells (equivalent to~/.bash_profile).~/.tcshrcor~/.cshrc: runs on all interactive shells (equivalent to~/.bashrc).
Common pitfalls¶
Loading modules in your dotfiles
While it can be convenient to auto-load modules in your ~/.bashrc, be careful: modules loaded in your shell startup can interfere with job scripts that expect a clean environment. If you do this, consider adding module purge at the top of your SLURM scripts.
Printing output in dotfiles
Avoid putting echo or other commands that produce output in your dotfiles. This can break non-interactive tools like scp and sftp, which expect a silent login.
Overriding critical environment variables
Be cautious when modifying PATH, LD_LIBRARY_PATH, or MODULEPATH in your dotfiles. Incorrect values can prevent modules from loading or cause software to malfunction. Always prepend rather than replace:
# Good: prepend to existing PATH
export PATH=$HOME/bin:$PATH
# Bad: replaces entire PATH
export PATH=$HOME/bin