Linux command
module 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
module avail
Search
module avail [module_name]
Load
module load [module_name]
Example
module list
Unload
module unload [module_name]
Unload all
module purge
Save
module save [collection_name]
Restore
module restore [collection_name]
说明
module provides a user interface to the Environment Modules package, enabling dynamic modification of the shell environment through modulefiles. Each modulefile contains configuration for applications, typically modifying PATH, MANPATH, LD_LIBRARY_PATH, and other environment variables. The system allows users to load and unload software configurations without manual environment variable management. Modulefiles are interpreted as Tcl scripts and can set variables, create aliases, and define dependencies. Collections allow saving and restoring sets of loaded modules, useful for switching between project configurations or workflows.
参数
- avail _pattern_
- List available modulefiles matching optional pattern
- load _modulefile_...
- Load modules into the current environment
- unload _modulefile_...
- Remove modules from the environment
- list _pattern_
- List currently loaded modules
- purge -f
- Unload all loaded modules
- reload -f
- Unload then reload all modules
- switch _old_ _new_
- Replace one module with another
- save _collection_
- Save current environment state to collection
- restore _collection_
- Restore saved environment collection
- savelist
- List saved collections
- display _modulefile_
- Show modulefile contents and effects
- whatis _string_
- Search modulefile descriptions
- use _path_...
- Add directories to modulefile search path
- --json, -j
- Output in JSON format
- --long, -l
- Long format output
- --terse, -t
- Short format output
- -v, --verbose
- Enable verbose messages
FAQ
What is the module command used for?
module provides a user interface to the Environment Modules package, enabling dynamic modification of the shell environment through modulefiles. Each modulefile contains configuration for applications, typically modifying PATH, MANPATH, LD_LIBRARY_PATH, and other environment variables. The system allows users to load and unload software configurations without manual environment variable management. Modulefiles are interpreted as Tcl scripts and can set variables, create aliases, and define dependencies. Collections allow saving and restoring sets of loaded modules, useful for switching between project configurations or workflows.
How do I run a basic module example?
Run `module avail` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does avail _pattern_ do in module?
List available modulefiles matching optional pattern