命令行大全

finger

rose1 发表于 2020-09-15 09:03浏览次数:

在类似Unix的操作系统上,finger命令将查找并显示有关系统用户的信息。

查看英文版

目录:

1 finger 运行系统环境

2 finger 语法

3 finger 例子

finger 运行系统环境

Linux

finger 语法

finger [-lmsp] [user ...] [user@host ...]

选件

-s 显示用户的登录名,真实姓名,终端名称和写状态(如果拒绝写权限,则在终端名称后显示为“ * ” ),空闲时间,登录时间,办公室位置和办公室电话号码。

登录时间显示为月,日,小时和分钟,除非已超过六个月前,在这种情况下,将显示年份而不是小时和分钟。

未知设备以及不存在的空闲和登录时间均显示为单个星号。
-l 产生多行格式,显示针对-s选项描述的所有信息以及用户的主目录,家庭电话号码,登录外壳,邮件状态以及文件“ .plan”,“。project”的内容,用户主目录中的 “ .pgpkey”和“ .forward” 。

指定为十一位数字的电话号码打印为“ + N-NNN-NNN-NNNN ”。指定为十位数或七位数的数字将作为该字符串的适当子集进行打印。指定为五位数字的数字被打印为“ xN-NNNN ”。指定为四位数的数字将打印为“ xNNNN ”。

(关闭消息)在包含设备名称的行之后添加。- l选项为每个用户显示一个条目;如果用户多次登录,则每次登录都会重复一次终端信息。

邮件状态显示为“ 没有邮件。“如果根本没有邮件,”如果该人自收到新邮件以来一直在看他们的邮箱,则为“ 上次读取的邮件DDD MMM ## HH:MM YYYY(TZ) ”,否则为“未读”因为...”,如果他们有新邮件。
-p 防止-l的选项手指从显示“的内容。计划 ”,“ .project文件 ”“ .pgpkey ”文件。
-m 防止用户名匹配。的用户通常是一个登录名; 但是,除非提供-m选项,否则还将对用户的真实姓名进行匹配。用手指执行的所有名称匹配都不区分大小写。

如果未指定任何选项,则在提供操作数的情况下,finger默认为-l样式输出,否则为-s样式。请注意,如果没有可用的信息,则可能会缺少两种格式的某些字段。

如果未指定任何参数,finger将为当前登录到系统的每个用户打印一个条目。 

Finger可用于在远程计算机上查找用户。格式是将用户指定为“ user @ host ”或“ @host ”,其中前者的默认输出格式为-l样式,后者的默认输出格式为-s样式。该-l选项是可以传递到远程机器的唯一选择。

如果标准输出是套接字,则finger将在每次换行(^ J)之前发出回车符(^ M)。这种格式是用于当由调用处理远程手指请求的fingerd,手指守护程序。

档案

~/.nofinger 如果finger在用户的主目录中找到此文件,则对于源于本地主机之外的finger请求,它将坚决拒绝该用户的存在。为此,fingerd启动的finger程序必须能够查看.nofinger文件。通常,这意味着包含文件的主目录必须设置“ 其他用户执行”位(o + x)。(请参阅chmod)。如果出于隐私目的使用此功能,请以“ finger @localhost ”进行测试,以防万一。
~/.plan

~/.project

~/.pgpkey
这些文件作为长格式请求的一部分
finger [-lmsp] [user ...] [user@host ...]

Options

-s Displays the user's login name, real name, terminal name and write status (as a "*" after the terminal name if write permission is denied), idle time, login time, office location and office phone number.

Login time is displayed as month, day, hours and minutes, unless more than six months ago, in which case the year is displayed rather than the hours and minutes.

Unknown devices as well as nonexistent idle and login times are displayed as single asterisks.
-l Produces a multi-line format displaying all of the information described for the -s option as well as the user's home directory, home phone number, login shell, mail status, and the contents of the files ".plan", ".project", ".pgpkey" and ".forward" from the user's home directory.

Phone numbers specified as eleven digits are printed as "+N-NNN-NNN-NNNN". Numbers specified as ten or seven digits are printed as the appropriate subset of that string. Numbers specified as five digits are printed as "xN-NNNN". Numbers specified as four digits are printed as "xNNNN".

If write permission is denied to the device, the phrase "(messages off)" is appended to the line containing the device name. One entry per user is displayed with the -l option; if a user is logged on multiple times, terminal information is repeated once per login.

Mail status is shown as "No Mail." if there is no mail at all, "Mail last read DDD MMM ## HH:MM YYYY (TZ)" if the person has looked at their mailbox since new mail arriving, or "New mail received ...", " Unread since ..." if they have new mail.
-p Prevents the -l option of finger from displaying the contents of the ".plan", ".project" and ".pgpkey" files.
-m Prevent matching of usernames. The user is usually a login name; however, matching will also be done on the users' real names, unless the -m option is supplied. All name matching performed by finger is case insensitive.

If no options are specified, finger defaults to the -l style output if operands are provided, otherwise to the -s style. Note that some fields may be missing, in either format, if information is not available for them.

If no arguments are specified, finger will print an entry for each user currently logged into the system.

Finger may be used to look up users on a remote machine. The format is to specify a user as "user@host", or "@host", where the default output format for the former is the -l style, and the default output format for the latter is the -s style. The -l option is the only option that may be passed to a remote machine.

If standard output is a socket, finger will emit a carriage return (^M) before every linefeed (^J). This format is for processing remote finger requests when invoked by fingerd, the finger daemon.

Files

~/.nofinger If finger finds this file in a user's home directory, it will, for finger requests originating outside the local host, firmly deny the existence of that user. For this to work, the finger program, as started by fingerd, must be able to see the .nofinger file. This generally means that the home directory containing the file must have the other-users-execute bit set (o+x). (See chmod). If you use this feature for privacy, please test it with "finger @localhost" before relying on it, just in case.
~/.plan

~/.project

~/.pgpkey
These files are printed as part of a long-format request. The .plan file may be of any length.

查看英文版

查看中文版

finger 例子

finger -p ch

显示有关用户ch的信息。输出将类似于以下内容:

Login name: admin
In real life: Computer Hope
On since Feb 11 23:37:16 on pts/7 from domain.computerhope.com
28 seconds Idle Time
Unread mail since Mon Feb 12 00:22:52 2001
finger -p ch

Display information about the user ch. Output will appear similar to the following:

Login name: admin
In real life: Computer Hope
On since Feb 11 23:37:16 on pts/7 from domain.computerhope.com
28 seconds Idle Time
Unread mail since Mon Feb 12 00:22:52 2001

查看英文版

查看中文版