【问题标题】:Why is `pw_gecos` named as such?为什么 `pw_gecos` 是这样命名的?
【发布时间】:2017-07-11 09:56:06
【问题描述】:

在 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 */
};

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

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

【问题讨论】:

标签: linux linux-kernel passwd


【解决方案1】:

来自wikipedia

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

贝尔实验室的一些早期 Unix 系统使用 GECOS 机器进行打印 spooling 和其他各种服务,所以这个字段被添加到携带 有关用户 GECOS 身份的信息。

【讨论】:

    猜你喜欢
    • 2021-06-08
    • 1970-01-01
    • 1970-01-01
    • 2016-05-16
    • 1970-01-01
    • 1970-01-01
    • 2016-04-12
    • 2010-10-27
    • 2016-02-24
    相关资源
    最近更新 更多