
Linux finger命令说明
finger 是 Linux 系统中的一个实用命令,用于查看其他用户的详细信息。通过该命令可以获取以下信息:
- 登录名(Login Name)
- 用户全名(User Name)
- 主目录(Home directory)
- 使用的 Shell(Shell)
- 登录状态(Login status)
- 邮件状态(mail status)
- .plan 文件内容
- .project 文件内容
- .forward 文件内容
其中 .plan、.project 和 .forward 是位于用户主目录下的隐藏文件,如果存在则显示其内容,否则不显示。finger 命令不仅可以查询本地用户信息,还可以用于查找远程主机上的用户信息。只需提供类似电子邮件地址的格式即可完成远程查询。
执行权限:所有用户均可使用。
命令格式
finger [参数] user[@地址]
常用参数说明:
- -l 以多行形式显示完整信息。
- -s 以单行形式简要显示,包括登录名、真实姓名、终端名、空闲时间、登录时间、办公室电话和电话号码等。若查询的是远程用户,则此选项无效。
示例操作
显示当前系统中所有登录用户的信息:
# finger -l Login: root Name: root Directory: /root Shell: /bin/bash On since Fri Apr 9 20:17 (CST) on :0 (messages off) On since Fri Apr 9 20:17 (CST) on pts/1 32 days 22 hours idle On since Fri Apr 9 20:17 (CST) on pts/3 4 hours 5 minutes idle (messages off) On since Wed May 12 18:08 (CST) on pts/4 from 192.168.1.10 On since Wed May 12 18:35 (CST) on pts/5 from 192.168.1.10 7 minutes 54 seconds idle On since Wed May 12 14:37 (CST) on pts/2 from 192.168.1.10 3 hours 14 minutes idle On since Wed May 12 14:53 (CST) on pts/7 34 minutes 25 seconds idle (messages off) On since Wed May 12 16:53 (CST) on pts/8 from 192.168.1.10 30 minutes 18 seconds idle Mail last read Mon Mar 31 04:02 2008 (CST) No Plan.
查看特定用户的资料信息:
# finger -m hnlinux
查询远程主机上的用户信息:
# finger -m root@192.168.1.13
查看本机管理员账户信息:
finger root
输出结果如下:
Login: root Name: root Directory: /root Shell: /bin/bash Never logged in. No mail. No Plan.










