Linux rmmod命令

Linux 命令大全 Linux 命令大全

Linux rmmod命令用於刪除模組。

執行rmmod指令,可刪除不需要的模組。Linux操作系統的核心具有模組化的特性,應此在編譯核心時,務須把全部的功能都放如核心。你可以將這些功能編譯成一個個單獨的模組,待有需要時再分別載入它們。

語法

rmmod [-as][模組名稱...]

參數

  • -a  刪除所有目前不需要的模組。
  • -s  把資訊輸出至syslog常駐服務,而非終端機介面。

實例

顯示已安裝的模組

# lsmod
Module         Size Used by
cramfs         39042 1
nfsd         238935 11
lockd         64849 1 nfsd
nfs_acl         2245 1 nfsd
auth_rpcgss      33735 1 nfsd
sunrpc        193181 10 nfsd,lockd,nfs_acl,auth_rpcgss
exportfs        3437 1 nfsd
xt_TCPMSS        2931 0
xt_tcpmss        1197 0
xt_tcpudp        2011 0
iptable_mangle     2771 0
ip_tables        9991 1 iptable_mangle
x_tables        14299 4

……省略部分結果
pppoe          8943 0
pppox          2074 1 pppoe
binfmt_misc       6587 1
snd_ens1371      18814 0
gameport        9089 1 snd_ens1371
snd_ac97_codec    100646 1 snd_ens1371
ac97_bus        1002 1 snd_ac97_codec
snd_pcm_oss      35308 0

卸載模組

# rmmod -v pppoe //卸載模組pppoe
Checking ppoe for persistent data

安裝模組

# insmod -v pppoe >1.log //安裝模組

~# tail -b 30 1.log //顯示檔資訊

Linux 命令大全 Linux 命令大全