Linux Finger Command to Find User Details

linux finger command

Finger command is used in Linux and Unix-like system to check the information of any currently logged in users from the terminal. It is a command-line utility that can provide users login time, tty (name), idle time, home directory, shell name, etc.

Finger package is not installed by default in most Linux and Ubuntu, other Debian flavored systems. In this tutorial, we will check how to install and use finger command in Linux.

Finger Command Syntax

The following command shows the syntax of finger command:

finger [-lmsp] [user1 user2 ….. ]

Install finger

You can use the following command to install finger command in Linux distributions.

On Ubuntu and Debian systems:

$ sudo apt-get install finger

On Fedora systems:

$ sudo dnf install finger

On Redhat and CentOS systems you can install using yum command or download package.

$ sudo yum install finger

1) Finger command with option -s

With -s option finger command will print the user's login name, real name, terminal name and write status ( the asterisk before terminal name mean that you don’t have write permission with that device ), idle time, login time, office location and office phone number.

The login time is displayed with MM DD HH:mm format. If the time exceeds six months, the year is displayed rather than the hours and minutes.

finger command with s option

2) Finger command with option -l

Finger command with -l option displays all of the information described for the -s option as well as the user's home directory, home phone number, login shell, mail status, etc.

linux finger command

The phrase “(messages off)'' means that user ‘harry’ doesn’t have write permission to ‘root’ on the devices pts/4 and pts/7. If a user is logged on multiple times, terminal information is repeated once per login.

Also returns '.plan', '.project' and '.pgpkey' files if any. In the above screenshot the user 'harry' has 'no plan'.

3) Finger command with option -p

The option -p is completely same with option -l, except it doesn’t include '.plan', '.project' and '.pgpkey' files of users in returned result.

linux finger command

4) Finger command with option -m

With -m option finger command will prevent matching of user names in the returned result. All name matching performed by finger is case insensitive.

For example, our system has two users named ‘harry’ and ‘harry1’. Without option -m, finger command will return information of both users and only return information of user ‘harry’ if there -m follow.

With -m option

linux finger command

Without -m option

linux finger command options

If no options are specified, finger defaults to the -l style output if operands are provided, otherwise to the -s style.

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

linux command finger

Conclusion

In this tutorial, we learned how to use finger command to print user information. I hope you enjoyed reading and please leave your suggestion in the below comment section.

Bobbin Zachariah 8:49 pm

Comments

Your email address will not be published. Required fields are marked *