linux命令详解:finger

    xiaoxiao2025-05-16  11

    【finger命令】

    finger命令用来查找并显示用户信息,系统管理员通过使用该命令可以知道某个时候到底有多少用户在使用这台Linux主机。

    【命令常用格式】

    usage: finger [-lmsp] [user ...] [user@host ...] 命令中各选项的含义如下: -l 列出该用户的帐号名称,真实姓名,用户专属目录,登入所用的 Shell,登入时间,转信地址,电子邮件状态,还有计划文件和方案文件内容。 -m 排除查找用户的真实姓名。 -s 列出该用户的帐号名称,真实姓名,登入终端机,闲置时间,登入时间以及地址和电话。 -p 列出该用户的帐号名称,真实姓名,用户专属目录,登入所用的 Shell,登入时间,转信地址,电子邮件状态,但不显示该用户的计划文件和方案文件内容。

    【使用说明】

     finger -s Login Name Tty Idle Login Time Office Office Phone ubuntu ubuntu tty1 2d Aug 5 09:38 ubuntu ubuntu pts/0 Aug 13 21:59 (xxx.xxx.xxx.xxx)  finger -l Login: ubuntu Name: ubuntu Directory: /home/ubuntu Shell: /bin/bash On since Fri Aug 5 09:38 (CST) on tty1 2 days 11 hours idle On since Sat Aug 13 21:59 (CST) on pts/0 from xxx.xxx.xxx.xxx 2 seconds idle No mail. No Plan. ps: 顺带认识一下chfn命令

    【chfn命令】

    chfn,即change finger information,是用来改变 finger 指令显示的信息。 chfn 指令可用来更改执行 finger 指令时所显示的信息,这些信息都存放在/etc 目录里的 asswd 文件里。若不指定任何参数,则 chfn 指令会进入问答式界面。

    【命令常用格式】

    Usage: chfn [options] [LOGIN] Options: -f, --full-name FULL_NAME change user's full name -h, --home-phone HOME_PHONE change user's home phone number -o, --other OTHER_INFO change user's other GECOS information -r, --room ROOM_NUMBER change user's room number -R, --root CHROOT_DIR directory to chroot into -u, --help display this help message and exit -w, --work-phone WORK_PHONE change user's office phone number 参数: -f <真实姓名>或--full-name<真实姓名> 设置真实姓名。-h <家中电话>或--home-phone<家中电话> 设置家中的电话号码。-o <办公地址>或--office<办公地址> 设置办公室的地址。-u 或--help 在线帮助。

    【命令使用】

     sudo chfn -h 1234567890  sudo chfn -f l  finger root Login: root Name: l Directory: /root Shell: /bin/bash Home Phone: 123-456-7890 Last login Thu Jan 1 08:00 1970 (CST) on No mail. No Plan.
    转载请注明原文地址: https://ju.6miu.com/read-1298941.html
    最新回复(0)