为什么 `pw_gecos` 这么命名?

Wil*_*tin 5 linux passwd linux-kernel

在 passwd 结构中:

struct passwd {
    char   *pw_name;       /* username */
    char   *pw_passwd;     /* user password */
    uid_t   pw_uid;        /* user ID */
    gid_t   pw_gid;        /* group ID */
    char   *pw_gecos;      /* user information */
    char   *pw_dir;        /* home directory */
    char   *pw_shell;      /* shell program */
};
Run Code Online (Sandbox Code Playgroud)

参考: http: //man7.org/linux/man-pages/man3/getpwnam.3.html

user information通常是用户的全名)可在属性中找到pw_gecos。gecos 是什么意思,为什么这么命名,以及这个名称背后的历史是什么?

小智 3

来自维基百科

gecos 字段或 GECOS 字段是 Unix 和类似操作系统上 /etc/passwd 文件中的一个条目。它通常用于记录有关帐户或其用户的一般信息,例如他们的真实姓名和电话号码。

贝尔实验室的一些早期 Unix 系统使用 GECOS 机器进行打印假脱机和各种其他服务,因此添加了该字段来携带有关用户 GECOS 身份的信息。