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 Jalapeno computers.

Introd​​uction

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 (jalapeno 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 jalapeno will result in .bash_profile being loaded (or sourced) whereas ssh jalapeno date will result in .bashrc being loaded, the date printed and you returning to your computer.

.bash​​_profile

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.

Newly created accounts look for a file ~/.local_profile and will load the settings stored in this file, so if you wish to make modifications, create this file and put them there. The current version of the .bash_profile will automatically include the content of .bashrc, so there is no need to duplicate content in there.

For legacy accounts, either  grab a new copy of our .bash_profile (cp /usr/local/fmrib/skel/dotfiles/bash_profile ~/.bash_profile) and then create the ~/.local_profile or  if you have changes in your .bash_profile you do not want to loose, you can modify it as follows.

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
    fi

Then add this before the section:

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

           exec $SHELL

        fi

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.

.bashrc

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