msgid - 生成消息 ID
/usr/sbin/msgid
msgid 实用程序可生成消息 ID。
消息 ID 是用于唯一标识消息的数字标识符。虽然两个不同消息具有相同 ID 的可能性很高,但可以通过适当的优先级或 facility.level 指示符来显著降低这种可能性(请参见 syslogd(8))。Specifically, the message ID is a hash signature on the message's unexpanded format string, generated by STRLOG_MAKE_MSGID() as defined in <sys/strlog.h>.
msgid is a simple filter that takes strings as input and produces those same strings, preceded by their message IDs, as output.Every message logged by syslogd(8) includes the message ID.消息 ID 可用作一个小标识符,该标识符与语言无关。
以下示例将使用 msgid 命令为 echo 命令生成消息 ID。
example# echo hello | msgid 205790 hello example#示例 2 使用 msgid 命令生成消息目录
以下示例将使用 msgid 命令在 x86 计算机中以二进制 zfs 格式枚举所有消息以生成消息目录。
example# strings /kernel/fs/amd64/zfs | msgid ... 726970 stride_hits 766819 stride_misses 929857 reclaim_successes 412490 reclaim_failures 234331 streams_resets 737841 streams_noresets 471619 bogus_streams 878613 onloan_read_buf ...
有关下列属性的说明,请参见 attributes(7):
|