聯系我們 - 廣告服務 - 聯系電話:
您的當前位置: > 關注 > > 正文

天天觀察:nix系統上加載/管理模塊的命令 linux常用命令之module

來源:CSDN 時間:2023-03-16 07:28:37

module概述

module是 *nix 系統上加載/管理模塊的命令。

module安裝


(資料圖片僅供參考)

大多數發行版上并未默認安裝,運行該命令則會出現如下錯誤:

module: command not found。

需手動執行安裝命令,安裝軟件包 environment-modules:

For CentOS:

[root@localhost ~]# dnf install environment-modules

For Ubuntu:

[miya@localhost ~]# sudo apt-get install environment-modules

注意:安裝完成后,已打開的終端要重新打開,命令才能生效。

語法格式

module [options] [command] [args ...]

參考實例

列出已加載的模塊:list

[root@localhost ~]# module listNo Modulefiles Currently Loaded.

查看可用模塊:avail

[root@localhost ~]# module avail-------------------------------------------------- /usr/share/Modules/modulefiles ---------------------------------------------------dot  module-git  module-info  modules  null  use.own

顯示模塊信息:show/display

[root@localhost ~]# module avail-------------------------------------------------- /usr/share/Modules/modulefiles ---------------------------------------------------dot  module-git  module-info  modules  null  use.own------------------------------------------------------- /root/privatemodules --------------------------------------------------------null[root@localhost ~]# [root@localhost ~]# module show null-------------------------------------------------------------------/usr/share/Modules/modulefiles/null:module-whatis   {does absolutely nothing}-------------------------------------------------------------------[root@localhost ~]# [root@localhost ~]# module display module-git-------------------------------------------------------------------/usr/share/Modules/modulefiles/module-git:module-whatis   {get last version of the module sources from GitHub}set-alias       get-modules {git clone git://github.com/cea-hpc/modules.git && cd modules}-------------------------------------------------------------------

加載模塊:add/load

[root@localhost ~]# module add dot[root@localhost ~]# module load use.own[root@localhost ~]# module listCurrently Loaded Modulefiles: 1) dot   2) use.own

重新加載模塊:reload/refresh

[root@localhost ~]# module reload[root@localhost ~]# module refresh

卸載模塊:rm/unload

[root@localhost ~]# module listCurrently Loaded Modulefiles: 1) use.own   2) dot[root@localhost ~]# module rm use.own[root@localhost ~]# module unload dot[root@localhost ~]# module listNo Modulefiles Currently Loaded.

清空模塊:clear/purge

[root@localhost ~]# module listCurrently Loaded Modulefiles: 1) null[root@localhost ~]# module clearAre you sure you want to clear all loaded modules!? [n] y[root@localhost ~]# module listNo Modulefiles Currently Loaded.[root@localhost ~]# [root@localhost ~]# module listNo Modulefiles Currently Loaded.[root@localhost ~]# module add null[root@localhost ~]# module listCurrently Loaded Modulefiles: 1) null[root@localhost ~]# module purge[root@localhost ~]# module listNo Modulefiles Currently Loaded.

責任編輯:

標簽:

相關推薦:

精彩放送:

新聞聚焦
Top 岛国精品在线