In this exercise we will set up some simple customizations and try some examples with modules. At this point, log in to Vista. If you have already set up some customizations, you may want to back them up before proceeding, and then restore them afterwards.

To customize the environment on Vista, we will edit the .bashrc file in your $HOME directory. This file should be sourced by .profile. To verify this, open .profile with your text editor or choice, and verify that it has the following lines (if not, then add them):

Now, open your .bashrc file and notice the structure. TACC has already added some customizations by default for your convenience. If you have the default script, you will see a section beginning on line 60 where you can load modules, for example. Let's prepare to add a module there.

Say you have written your own code that you would like to run on Vista, and you have a Apptainer container with your code in it. Then you will want to load Apptainer into your environment before you can use your container. You can view which modules have been loaded into your environment by default with module list and verify that no Apptainer module was loaded. So, let's search for it:

We can see that TACC uses a module called tacc-apptainer and that two versions are available. We can load the latest version shown by module spider by entering ml tacc-apptainer/1.4.1. It's often best to supply the specific version number, unless the version number is unimportant and TACC's chosen default (which may change) is acceptable. This holds true even if a module has just one version. Going back into your .bashrc with a text editor, add module load tacc-apptainer/1.4.1 in Section 1. You can verify that this does what you expect by logging out and back in, and executing module list to see that it now includes tacc-apptainer/1.4.1.

Say instead you installed some software in the bin directory of your home directory, or you simply copied a binary there, and you want to make it available through the path environment variable so that it can be executed by name on a command line. If you open up your .bashrc, you will see that in Section 2 of the default script supplied by TACC, there is an example for adding the $HOME/bin directory to the head of your path:

You can simply uncomment this example and place your binaries there, or you can specify a custom directory. Remember to log out and log back in to see the changes, or you can source the file to see them immediately.

One last example of a handy customization is to add aliases. Aliases can be used for many things, but they are convenient for simplifying your workflow. For example, say you often mistype ls for listing as sl but do not want this to hinder your workflow. A solution is to alias the mistyped command to execute the correct one. Before you do this, it is important to verify that you are not going to obscure a command of the same name by accident. For this we are safe because trying sl yields:

So now open .bashrc and in Section 2 after the "Place anything else below" comment, add:

Now source the file or log off and on again to test it out. If you type sl within your shell, it will list files and directories as if you had typed ls correctly. The possibilities of customization are quite endless. Try out what makes your workflow comfortable and convenient.

To return to the default setup and erase all customizations that we've made today, as well as those you may have set up before this exercise, execute:

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)