To manage your default environment through modules, begin by adding to the end of your ~/.bashrc or ~/.cshrc startup script the line
module load null
The “null” module actually does nothing in and of itself; it merely provides a placeholder for the following commands to operate on.
Can by unloading this module you restore the default environment?
Next, to add a module to your default environment, use the command
module initadd [module name]
This will alter the “module load” line in your startup script (,bashrc in case of bash) to load this module at each shell invocation. In this way you can manage your default environment through the modules package without editing your startup scripts.
To disable a default module, use “initrm”
module initrm [module name]
This removes that module from the module line in your startup script.