命令行大全

modinfo

瑞兹 发表于 2021-02-03 09:03浏览次数:

在Linux操作系统上,modinfo命令显示有关内核中插入的模块的信息。

查看英文版

目录:

1 modinfo 运行系统环境

2 modinfo 描述

3 modinfo 语法

4 modinfo 例子

modinfo 运行系统环境

Unix&Linux

modinfo 描述

modinfo命令从所给的Linux内核模块的命令提取信息的命令行。如果模块名称不是文件名,则搜索/ lib / modules / kernel-version目录-加载内核模块时,modprobe搜索相同的目录。

默认情况下,modinfo以以下形式列出模块的每个属性:

field name : value

模块文件名以相同的方式列出。

modinfo可以理解任何Linux内核体系结构的模块。

The modinfo command extracts information from the Linux kernel modules given on the command line. If module name is not a file name, then the /lib/modules/kernel-version directory is searched — the same directory searched by modprobe when loading kernel modules.

By default, modinfo lists each attribute of the module in the form:

field name : value

The module file name is listed the same way.

modinfo can understand modules of any Linux Kernel architecture.

查看英文版

查看中文版

modinfo 语法

modinfo [-0] [-F field] [-k kernel] [module name|file name...]
modinfo -V
modinfo -h

选件

-V,-- version 打印modinfo的版本,然后退出。
-F,-- field field name 仅打印名为field name的字段的值。字段名称不区分大小写。公共字段名authordescriptionlicenseparmdependsalias。对于给定的字段名称,通常有多个字段,例如parmaliasdepends。每行打印多个值。特殊字段名称file name列出了模块的文件名。
-k kernel 提供有关正在运行的内核以外的内核的信息。对于需要从新安装(但尚未运行)的内核模块集中提取信息的发行版,此开关特别有用。
-0,-- null 使用ASCII NULL 字符来分隔字段值,而不是换行符。此开关对于解析字段数据很有用,因为换行符可能是字段值的一部分。
-a-d-l-p-n 这些是用于显示字段authordescriptionlicenseparmfile name的快捷方式。
modinfo [-0] [-F field] [-k kernel] [module name|file name...]
modinfo -V
modinfo -h

Options

-V--version Print the version of modinfo, and exit.
-F--field field name Only print the value of the field named field name. Field names are case-insensitive. Common field names are authordescriptionlicenseparmdepends, and alias. There are often multiple fields for a given field name, for instance parmalias, and depends. Multiple values are printed one per line. The special field name, file name, lists the file name of the module.
-k kernel Provide information about a kernel other than the running one. This switch is particularly useful for distributions needing to extract information from a newly-installed (but not yet running) set of kernel modules.
-0--null Use the ASCII NULL character to separate field values, instead of a newline. This switch is useful for parsing field data, because a newline might be part of a field's value.
-a-d-l-p-n These are shortcuts for displaying the fields authordescriptionlicenseparm, and file name.

查看英文版

查看中文版

modinfo 例子

modinfo snd

显示有关snd Linux内核模块的所有可用信息。输出将类似于以下内容:

file name:       /lib/modules/3.2.0-4-686-pae/kernel/sound/core/snd.ko
alias:          char-major-116-*
license:        GPL
description:    Advanced Linux Sound Architecture driver for sound cards.
author:         Jaroslav Kysela 
license:        GPL
description:    Jack detection support for ALSA
author:         Mark Brown 
depends:        soundcore
intree:         Y
vermagic:       3.2.0-4-686-pae SMP mod_unload modversions 686 
parm:           slots:Module names assigned to the slots. (array of charp)
parm:           major:Major # for sound driver. (int)
parm:           cards_limit:Count of auto-loadable sound cards. (int)
modinfo -F parm snd

显示snd Linux内核模块的所有parm(参数)字段。输出将类似于以下内容(请注意,字段名称不为字段值加上前缀):

slots:Module names assigned to the slots. (array of charp)
major:Major # for sound driver. (int)
cards_limit:Count of auto-loadable sound cards. (int)
modinfo snd

Display all available information about the snd Linux kernel module. Output will resemble the following:

file name:       /lib/modules/3.2.0-4-686-pae/kernel/sound/core/snd.ko
alias:          char-major-116-*
license:        GPL
description:    Advanced Linux Sound Architecture driver for sound cards.
author:         Jaroslav Kysela 
license:        GPL
description:    Jack detection support for ALSA
author:         Mark Brown 
depends:        soundcore
intree:         Y
vermagic:       3.2.0-4-686-pae SMP mod_unload modversions 686 
parm:           slots:Module names assigned to the slots. (array of charp)
parm:           major:Major # for sound driver. (int)
parm:           cards_limit:Count of auto-loadable sound cards. (int)
modinfo -F parm snd

Display all parm (parameter) fields for the snd Linux kernel module. Output will resemble the following (Note that the field name does not prefix the field values):

slots:Module names assigned to the slots. (array of charp)
major:Major # for sound driver. (int)
cards_limit:Count of auto-loadable sound cards. (int)

查看英文版

查看中文版

发表评论
评论列表
共0条
点击加载更多