10 finger command examples in Linux [Cheat Sheet]

Introduction to finger command

Linux is a multi-user operating system. Several users can use a single system at the same time. It is important to have the system's user information. finger is a command-line utility in Linux which displays the user information. It displays the user’s login name, real name, terminal type, idle time, login time, office location, and office number. finger command is mostly helpful for system administrators to view the information about system users.

 

How to install finger

finger is not installed by default in any Linux distribution. You can install finger using the following command according to your Linux distribution.

Advertisement

To install finger on CentOS, Fedora, and RHEL

$ sudo yum install finger

To install finger on Ubuntu and Debian

$ sudo apt install finger

 

Syntax to use finger command in Linux

The syntax for finger command is as follows:

$ finger [option]

 

Different examples to use finger command

1. Display list of logged in user

When finger command is used without any arguments, it displays the information of currently logged-in users in the system.

$ finger

Sample Output:

finger command to display user information

 

2. Display information of the specific user (using short name)

finger command takes the name of a user as input and displays the information of that user.

Advertisement
$ finger user

Sample Output:

finger command to display information of specific user

It displays the following information.

  • Login: the login name of a user
  • Name: the full name of a user
  • Directory: the home directory of a user
  • Shell: the shell used by a user
  • On since: the user's logged-in time and date
  • Mail: show mails of a user if any
  • Plan: shows plans of a user

Users can have plans by creating a '.plan' and '.project' file in their home directory. Anything you write in the file will appear in the Plan field.

 

3. Display user information using the full name

You can also display the user information by using the full name of a user.

$ finger full_name

Sample Output:

finger command to display user information by their full name

 

4. Prevent matching the full name of the user

The -m option prevents finger from matching the full name of a user.

Advertisement
golinux@ubuntu-PC:~$ finger -m parker
finger: parker: no such user.

 

5. Display the specific user information in column

The -s option displays the specific user information in the column format or short format.

$ finger -s user

Sample Output:

finger command display user information in column

 

6. finger command to prevent displaying the plan, project, and PGP key detail

The -p option prevents the finger from displaying the contents of the '.plan', '.project', and '.pgpkey' files.

$ finger -p

Sample Output:

finger command to prevent displaying plan and project

 

7. Display user information in long format

The -l option causes finger to display the information of logged-in users in the long format.

$ finger -l

Sample Output:

Advertisement

finger command to display user information in long format

 

8. Create a plan for a user using finger command

You can create plans for a user by creating the '.plan' file in the home directory of a user.

$ cat > .plan

Sample Output:

finger command to show plans of a user

 

9. Create projects for a user using finger command

The '.project' file in the home directory contains the projects for a user.

$ cat > .project

Sample Output:

finger command to show projects of a user

 

10. Create PGP key for a user

You can create a custom PGP key for a user by creating '.pgpkey' file in the user's home directory.

$ cat > .pgp

Sample Output:

Advertisement

finger command to show pgp key of a user

 

Conclusion

In this tutorial, we have shown you how to use finger command in Linux. finger is a useful command to get information about users in the Linux system. If you still have any confusion, feel free to ask us in the comment section.

As an alternative, you can use pinky command (the lightweight version of finger), which also prints user information.

 

What’s Next

cat command examples for beginners [cheatsheet]
15 usermod command examples in Linux [Cheat Sheet]

 

Further Reading

man page for finger command
man page for pinky command

 

Didn't find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

Leave a Comment

X