finger Command in Linux with Examples

This tutorial explains Linux “finger” command, options and its usage with examples.

finger – user information lookup program

DESCRIPTION

The finger displays information about the system users.

SYNOPSIS

finger [-l] [-m] [-p] [-s] [username]

OPTIONS

advertisement
advertisement

-l
Force long output format.
-m
Match arguments only on user name (not first or last name).
-p
Suppress printing of the .plan file in a long format printout.
-s
Force short output format.

The finger command displays information about the users currently logged in to a host. The format of the output varies with the options for the information presented.

Default Format

The default format includes the following items:

Note: Join free Sanfoundry classes at Telegram or Youtube

Login name
Full user name
Terminal name
Write status (an * (asterisk) before the terminal name indicates that write permission is denied)
For each user on the host, the default information list also includes, if known, the following items:

Idle time (Idle time is minutes if it is a single integer, hours and minutes if a : (colon) is present, or days and hours if a “d” is present.)
Login time
Site-specific information

Longer Format

A longer format is used by the finger command whenever a list of user’s names is given. (Account names as well as first and last names of users are accepted.) This format is multiline, and includes all the information described above along with the following:

User’s $HOME directory
User’s login shell
Contents of the .plan file in the user’s $HOME directory
Contents of the .project file in the user’s $HOME directory

advertisement

EXAMPLES

1. View detail about a particular user

$ finger abc
Login: abc                          Name: (null)
Directory: /home/abc                Shell: /bin/bash
On since Mon Nov  1 18:45 (IST) on :0 (messages off)
On since Mon Nov  1 18:46 (IST) on pts/0 from :0.0
New mail received Fri May  7 10:33 2013 (IST)
Unread since Sat Jun  7 12:59 2003 (IST)
No Plan.

2. View login details and Idle status about an user

$ finger -s root
Login     Name       		Tty      Idle  Login Time   Office     Office Phone
root         root           *1    19d Wed 17:45
root         root           *2     3d Fri 16:53
root         root           *3        Mon 20:20
root         root           *ta    2  Tue 15:43
root         root           *tb    2  Tue 15:44

3. To get information about all users logged in to host alcat, enter

advertisement
$ finger @alcat

Information similar to the following is displayed:

[alcat.cass.com]
Login     Name        TTY     Idle         When      Site Info
Manish   Manish      console   2d   Mar 15 13:19
janet    Janet          pts0   11:  Mar 15 13:01
ankita   Ankita         tty0    3   Mar 15 13:01

Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.

If you wish to look at all Linux commands and their usage examples, go to Linux Commands Tutorial.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.