今天看到/etc/modprobe.conf文件中有如下内容:

alias eth0 pcnet32

其中alias啥意思,不太明白,查之,原来是给设备做备注的。开始也忘了查man,后来才知道啥意思,再查man,解释得很详细。

alias wildcard modulename
          This  allows  you  to  give  alternate  names  for  a  module.   For  example:  "alias  my-mod really_long_modulename"  means  you  can  use   "modprobe   my-mod"   instead   of   "modprobe really_long_modulename".    You   can  also  use  shell-style  wildcards,  so  "alias  my-mod* really_long_modulename" means that "modprobe my-mod-something" has the same effect.  You can’t have  aliases  to  other  aliases (that way lies madness), but aliases can have options, which will be added to any other options.

          Note that modules can also contain their own aliases, which you can see using modinfo.   These aliases  are  used as a last resort (ie. if there is no real module, install, remove, or alias command in the configuration).


 

大概意思如下,这儿全当给懒的man的童鞋作解释了

这使您可以给出一个模块备用名称。例如:“alias my-mod really_long_modulename“意味着你可以使用”modprobe my-mod“而不是”modprobe really_long_modulename“。您还可以使用shell风格的通配符,所以”alias my-mod* really_long_modulename“是指”modprobe my-mod-sonmething“具有相同的效果。不能有别名其他别名(这样是不明智的),但可以有其他选择的别名,而将被添加到任何其他选择。

请注意,模块也可以包含自己的别名,你可以看到使用modinfo命令。这些别名是作为最后手段(即如果没有真正的模块,安装,删除,或别名在配置命令)。

谷歌翻译加上冷博客修正的。简而言之,就是给你的设备起一个好记的别名,还是alias的基本用法,只不过没有给命令定义别名时的等号还有引号等等啦