Cookies on this website

We use cookies to ensure that we give you the best experience on our website. If you click 'Accept all cookies' we'll assume that you are happy to receive all cookies and you won't see this message again. If you click 'Reject all non-essential cookies' only necessary cookies providing core functionality such as security, network management, and accessibility will be enabled. Click 'Find out more' for information on how to change your cookie settings.

How to customise your terminal sessions on WIN servers.


The web is full of suggestions on how to make terminal sessions more productive; software packages request you make changes to your environment; you see a fancy prompt on someone else's terminal and want yours to behave the same - this page describes how to do that without breaking the system presets.

These instructions only apply to the centrally managed interactive Linux servers (, etc) - desktop computers (Linux/macOS) do not necessarily use the mechanisms below (or indeed use BASH at all).

We strongly recommend that you do not automatically activate any Conda Python environments in your profile, it is known to break VNC startup.

Configuration files

The shell you use on FMRIB computers is called BASH, it is setup through two files, .bash_profile and .bashrc which may contain the same types of configuration. The former is run when you log into a computer, usually via SSH, the later when you open a Linux terminal not configured as a login shell or when you run a command on a remote computer over an SSH connection.

For example, ssh will result in .bash_profile being loaded (or sourced) whereas ssh date will result in .bashrc being loaded, the date printed and you returning to your computer.


The .bash_profile is where we configure the system defaults, e.g. where to find software, what their settings are etc. You should take care with what you put in this file so as to not prevent these defaults from loaded.

By default, a new account's .bash_profile contains very little as most software setup is handled through the loading of environment modules.

Make sure you make a backup of your current .bash_profile if you have modifications you want to re-apply to the new profile.

Cluster defaults are loaded at the start of the file, do not change this section. After that feel free to modify the settings, but if you are at all unsure of what you are doing please contact the WIN IT team​ for advice. If you are missing the following:

    if [ -f ~/.bashrc ]; then
        . ~/.bashrc

Then add this before the section:

if [ "X$SHELL" != "X$CURSHELL" ]; then

           exec $SHELL


at the end of the file.

The latest version of this file adds a section that will load settings from a file ~/.local_profile, so if you have this version feel free to create this file and modify the settings there.


We recommend you use this file for setting up aliases.

Do not 'echo' any output in your .bashrc, this will break 'scp' commands. If you wish to run a command or source a setup script that outputs text either send the output to /dev/null or consider ensuring that this does not run when in a non-interactive session.

  • Redirecting output:
    • module add freesurfer/current > /dev/null

  • Prevent from non-interactive sessions
    • if [ -n "$SSH_TTY" ]; then echo "Hello"; fi