Previous Table of Contents Next


Module 56
finger

DESCRIPTION

The external finger command displays a detailed list of user information. If you specify a user_name, information for only that user is displayed. If no user_name is given, information for all users currently logged in to the system is displayed. By default, only a one-line summary of information is displayed for each user.

The following information is displayed by default:

*  Login name (user_name)
*  Full name, field five of the /etc/passwd file
*  Terminal name (tty device)
*  Write status of terminal. Terminal name is preceded by a "*" if write permission is denied to other users.
*  Idle time since the last keystrokes. A single digit represents minutes, a colon-separated number is hours:minutes, and a number preceded by "d" refers to days.
*  Login time
*  Office location
*  Phone number

If you specify user_names, then a full listing of information is displayed for each user you specify. This listing includes:

*  User's home directory
*  User's login shell
*  User's ~/.plan file
*  User's ~/.project file

in addition to the first list of information presented above.

The finger command can also be used to look up user information across a network. Be aware of a time delay for the information to be returned. On a local network it should respond within a few seconds, but it could be longer depending on the network traffic load and the remote system's load.

COMMAND FORMAT

Following is the general format of the finger command.

     finger [ -bfhilmpqsw ] user_name
     finger [ -l ] "user@host"

BSD (Berkeley)
finger [ -l ] [ -m ] [ -p ] [ -s ] [ user_name ] [ last ] [ first ]
finger "user@host"

Options

The following list describes the options and their arguments that may be used to control how finger functions.

-b Suppress the user's home directory and login shell from a long format display.
-f Suppress the default header from short format displays.
-h Suppress the .project file from a long format display.
-i Display "idle" output format, only the login name, terminal line, login time, and idles time are displayed.
-l Force a long output format. All of the information listed in the two previous lists is displayed.
-m Match arguments only against user names (field one of the /etc/passwd file). By default finger matches the arguments you provide against the username, first names or last names.
-p Suppress the display of the .plan files.
-q Display "quick" output format, only the login name, terminal line, and login time are displayed.
-s Force a short output format. Only the first set of information listed above is displayed.
-w Suppress the full user name from a short format display.

BSD (Berkeley)
Only the -l, -m, -p, and -s options are supported. They have the same meaning as the System V options.

Arguments

The following list describes the arguments that may be passed to the finger command.

first The first name of a user. finger searches the fifth field of the /etc/passwd file for a match.
last The last name of the user. finger searches the fifth field of the /etc/passwd file for a match.
user_name The name of the user you want information about.
user@host Requests information about a user residing on the system named host.
If no user is specified, information is returned for all current users logged into the system.

DIAGNOSTICS AND BUGS

The finger program only displays the first line of a user's $HOME/.project file, even if multiple lines exist.

If finger seems slow, it may be caused by a large /etc/passwd file. To help speed up finger use the -m option.

RELATED COMMANDS

Refer to the who command described in Module 159.

RELATED FILES

The following files are accessed by finger for the required information.

/etc/utmp The current who file
/etc/passwd The system's password file
/var/adm/lastlog An administrative file used to track the last login times of users
~/.plan The user's plan. In the academic world this was the major; in business it is usually future projects
~/.project The user's current project

APPLICATIONS

The finger command provides a quick way to retrieve information about a certain user or all users currently logged into the system. You can use finger to display information about a user you want to contact.

Remember, like any database, the information returned is only as useful as it is current. If you have a good system administrator that keeps the necessary files updated, then finger will prove to be a useful tool. If the data is outdated, finger will be a waste of time for certain information.

TYPICAL OPERATION

In this activity you use the finger command to display information about all current users. Begin at the shell prompt.

1.  Type finger and press Return. This will display information about each user currently logged on to the system.

In this activity you use finger to display all the information about your user name. Then update your .project file and rerun finger to see the difference.

1.  First type finger mylogin and press Return. Notice certain fields may be empty.
2.  Type cd and press Return to change to your home directory.
3.  Now type vi .project and press Return to edit your .project file.
A.  Type i to enter insert mode.
B.  Enter the desired text, only one line.
C.  Press Escape to exit insert mode.
D.  Type ZZ to save your file and exit vi.
4.  Type finger mylogin and press Return to display the additional information about yourself.
5.  Turn to Module 75 (SV), Module 160 (BSD) to continue the learning sequence.


Previous Table of Contents Next