finger tool: used to query user information, focusing on the user's home directory, login SHELL etc.

finger tool focused on the queries user information; contents of the query includes a user name (also known as login name Login), home directory, the user's real name (Name) ... ... office address, office phone; also include Log terminal, a write state, empty closed time;

Our most popular finger to query the user's home directory, the user's real name, the type SHELL, as well as office address and telephone use, which is a parameter -l long format output; and modifying the user's home directory, real name, office address and office telephone we are generally able to live chfn command;

Syntax:

finger [parameter options] [username]

-l using long format (the default), displayed by -s option contains all the information, as well as home directories, office address, office phone, log SHELL, message status, .plan, .project, and .forward;

-m ban users real name to match;

-p .project file and the contents .plan is omitted;

-s display short format, the user name (also known as login name Login), real name (NAME), in which the terminal login (Tty), write status, idle time (Idle), logon time (Login Time), office office telephone;

As finger What are the parameters, you can get by finger --help or man finger, we have to tell the most commonly used parameters examples in this article;

Example one: do not take any parameters, the user does not specify a query name; defaults to increase the -s parameter;

[beinan@localhost ~]$ finger

Login     Name            Tty      Idle  Login Time   Office     Office Phone

beinan    beinan sun    tty1     1:39  Nov  2 08:27

linuxsir  linuxsir open   tty2        2  Nov  2 10:03 linuxsir o +1-389-866-771

Equivalent command

[beinan@localhost ~]$ finger  -s

Note: no arguments, nor specify which user queries, finger will be the default for all users to log in short format -s output of the machine to the user name (also known as login name Login), real name (NAME), which terminal login (Tty), write status, idle time (idle), logon time (Login time), office location, office phone and so on;

In this example, there are beinan user logs on, the real name is beinan sun (the name is real name of the user, if not set when you add a user, not shown), registered in the terminal tty1, empty and closing time is 1 minute 39 seconds, the login time is Nov / 2/08: 27, office no name, no office phone;

Please explain this example beinan control user records, we take a look at this example linuxsir user information; should not be difficult.

About write state, if there is no output at the back Tty, said it is written, if * appears, indicating that no written or prohibited, as in the following example, ftp user does not log in through the terminal, because Tty is *, while Tty and there are a *, written or not written indicating the prohibition state (when the user is not logged in);

[beinan@localhost ~]$ finger -s ftp

Login     Name       Tty      Idle  Login Time   Office     Office Phone

ftp       FTP User    *     *  No logins

We may be in short form to query a user information output in short format, as in the following example;

[beinan@localhost ~]$ finger  -s   beinan

Example 2: Example -l respect to the output parameters of the user information length format;

finger -l case if you do not add a user name, you can list all user login information via tty; if you want to query a user, directly specify the user can specify one or more; what is tty login? If you are operating in full-screen text interface, you can press CTRL + F2 or CTRL + F3 or CTRL + F4, etc., to several different users log on to the host computer, you will see that each user has a different tty;

[beinan@localhost ~]$ finger -l

[beinan@localhost ~]$ finger -l  beinan linuxsir   注:可以同时查询几个用户信息,以长格式输出;

[beinan@localhost ~]$ finger beinan

Login: beinan                           Name: beinan sun

Directory: /home/beinan                 Shell: /bin/bash

On since Wed Nov  2 08:27 (CST) on tty1    2 hours 29 minutes idle

On since Wed Nov  2 10:50 (CST) on pts/0 from :0.0

No mail.

No Plan.

In this example, a user query is beinan, real name is beinan sun, the home directory is / home / beinan, the use SHELL type bash; then is by which terminal logged in, login time, is not a mail, there Plan Wait;

Three examples: Examples of combinations of parameters;

[beinan@localhost ~]$ finger -lp   beinan

Login: beinan                           Name: beinan sun

Directory: /home/beinan                 Shell: /bin/bash

On since Wed Nov  2 08:27 (CST) on tty1    2 hours 36 minutes idle

On since Wed Nov  2 10:50 (CST) on pts/0 from :0.0

No mail.

Note: Query beinan user information, and outputs the long format, and does not output .Plan and the content .Project;

Example IV: Comparison finger -s and who is and w;

For finger So much for it, very simple tools, when used with the -s parameter, you are the best tool for the control and w and who to see and who w finger -s and output what similarities and differences, and who are w which users login host query; and finger -s it, whether to log or not to log the user can check; but the content found in focusing on different; look at their example;

[beinan@localhost ~]$ finger -s

Login     Name            Tty      Idle  Login Time   Office     Office Phone

beinan    beinan sun      tty1     3:03  Nov  2 08:27

beinan    beinan sun      pts/0          Nov  2 10:50 (:0.0)

linuxsir  linuxsir open   tty2     1:26  Nov  2 10:03 linuxsir o +1-389-866-771

[beinan@localhost ~]$ w

11:30:36 up  3:04,  3 users,  load average: 0.30, 0.15, 0.10

USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT

beinan   tty1     -                08:27    3:03m  2:52   0.00s /bin/sh /usr/X11R6/bin/startx

linuxsir tty2     -                10:03    1:26m  0.01s  0.01s -bash

beinan   pts/0    :0.0             10:50    0.00s  0.16s  0.00s w

[beinan@localhost ~]$ who

beinan   tty1         Nov  2 08:27

linuxsir tty2         Nov  2 10:03

beinan   pts/0        Nov  2 10:50 (:0.0)

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11108625.html