Module Usage
Basic Module Commands
The most common module
commands are outlined in the following table.
module
commands may be shortened with the ml
alias, with slightly different
semantics.
Tip: Module names auto-completion
The
The
module
command supports auto-completion, so you can just start typing
the name of a module, and press Tab
to let the shell automatically
complete the module name and/or version.Module command | Short version | Description |
---|---|---|
module avail |
ml av |
List available software |
module spider anaconda |
ml spider anaconda |
Search for particular software |
module keyword conda |
ml key conda |
Search for conda in module names and descriptions |
module whatis anaconda |
ml whatis anaconda |
Display information about the anaconda module |
module help anaconda |
ml help anaconda |
Display module specific help |
module load anaconda |
ml anaconda |
Load a module to use the associated software |
module load anaconda/2 |
ml anaconda/2 |
Load specific version of a module |
module unload anaconda/3 |
ml -anaconda/3 |
Unload a module |
module swap anaconda/2 anaconda/3 |
ml -anaconda/2 anaconda/3 |
Swap a module (unload anaconda/2 and replace it with anaconda/3 ) |
module purge |
ml purge |
Remove all modules[^sticky_mod] |
module save foo |
ml save foo |
Save the state of all loaded modules in a collection named foo |
module restore foo |
ml restore foo |
Restore the state of saved modules from the foo collection |
Additional module sub-commands are documented in the module help
command.
For complete reference, please refer to the official Lmod documentation.
Saving Module Environments
Load some modules
$ module load fsl freesurfer workbench afni
Save loaded modules to a collection
$ module save collection1
This will create a file in /home/$user/.lmod.d/collection1
Use module describe
to list what is in a collection
$ module describe collection1
Collection "collection1" contains:
1) fsl 2) freesurfer 3) workbench 4) afni
To see a list of your collections use module savelist
$ module savelist
Named collection list :
1) default 2) collections1
When you logon later, you can use module restore
to get your enviroment back
$ module restore collections1
Restoring modules to user's collections1