Using finger command in Linux


Finger command in Linux is used to display the details of a user. It includes information like login name, username, login time, idle time, home directory, etc. This command is very useful in monitoring the users of a system.

In this article, we will discuss the usage of finger command on Linux with some examples.

Syntax of finger command

How to use finger command in Linux, the syntax is given below –

finger options user

For options that can be used with the finger command see its manual page.

How to install finger on Linux

This command does not come preinstalled in most of the Linux distribution. You can install this by using one of the following commands in your terminal.

To install the finger tool on a Debian based distro such as Ubuntu/Linux Mint/ Kali Linux, etc, use –

sudo apt install finger

If you want to use it on RHEL/ CentOS then use –

sudo yum install finger

To install finger on fedora use –

sudo dnf install finger

Once it gets installed successfully you can start using it.

Display details of a user

To display the details of a user, execute the following command in your terminal –

finger lalit

Now see the output of this command –

Using option -s or -l with finger command

When you use the  -s option with the finger command it shows the information of a user including login name, real name, TTY, idle and login time, office details, etc in a different format.

When you use the option -l it prints the output in a long listing format. It is the default view of the finger command, you can see the image in the previous section.

How to avoid printing PGP key, plan, and project details

If you want to omit the PGP key, plan, and project details from printing on standard output then use the option -p (no plan) with the finger command.

finger -p lalit

Now you can see in the output of this command –

How to display the information of multiple users using a single command

You can view the information of multiple users by using a single command. The command will print all the information one after the other.

For example –

finger lalit ftpuser

You can find more information on the finger command on its manual page. Use the following command to see its manual page –

man finger

Conclusion

This article explains how to use the finger command in Linux. Now if you have a query then write us in the comments below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.