Unix Shells & Command Line Interfaces (CLI)

Having confidence when using a Unix shell, particularly Bash, is crucial when working within an HPC environment. It can also be extraordinarily helpful when setting up development environments, running scripts in Python or R, or using containers and command line tools.

If you are looking to install Bash, you can find a helpful walkthrough here.

UBC Library Research Commons frequently runs introductory workshops on Bash, which are listed here. And the materials for these workshops are available below:

Additionally, the SFU’s Research Computing Group provides a full-day workshop on Bash during their annual Summer School in early June with some of the materials for that course available below:

Additional resources:

Running mamba on Git-Bash for Windows

When installing mamba via Miniforge with the recommended options, it is not included in your PATH by default, so you’ll only be able use it by running Miniforge Prompt from your Start Menu. For most folks that might be just fine, but we recommend adding both the mamba and conda commands to your Git-Bash environment, so you can more easily take advantage of Bash and Git.

Start by locating the ‘profile.d’ folder that was installed with Miniforge via the File Explorer. Most likely this would located at: C:\Users\<your_username>\miniforge3\etc. Right click the ‘profile.d’ folder and select ‘Open Git Bash here’. In the Git Bash terminal, run the following commands:

$ echo "source '${PWD}/conda.sh'" >> ~/.bashrc
$ echo "source '${PWD}/mamba.sh'" >> ~/.bashrc

Then restart your Bash session and check that mamba works:

$ source ~/.bashrc
$ mamba --version

You should see output telling you the versions of mamba and conda that are installed.

Command Line Tools

GDAL

GDAL is used by a variety of GIS software to read and write geospatial data, and it is one of the most commonly used geospatial libraries. A range of functionalities can be accessed through the various CLI tools that accompany it, including conversions between a large collection of raster and vector data formats.

You can install GDAL from the conda-forge repository using conda or mamba with one of the following commands:

$ mamba install libgdal -y
$ conda install -c conda-forge libgdal -y

ImageMagick

When processing large collections of images, ImageMagick is a very popular tool with an extraordinary amount of functionality. It’s commonly used to convert, resize, and optimize images files in various formats.

If you are using Windows, you can find an installer here, which will enable you to use ImageMagick from your preferred shell. Mac OS and Linux users can install ImageMagick from the conda-forge repository using conda or mamba with one of the following commands:

$ mamba install imagemagick -y
$ conda install -c conda-forge imagemagick -y

FFmpeg

FFmpeg is an extremely powerful tool for batch processing both video and audio files. It can be installed using one of the following commands:

$ mamba install ffmpeg -y
$ conda install -c conda-forge ffmpeg -y