Categories: TutorialsUbuntu

Linux finger command to find user details

The finger command is used in Linux and Unix-like systems to check the information of all currently logged on users from the terminal. It is a command line utility that gives users logon time, tty (name), idle time, home directory, shell name, etc.

The Finger package is not installed by default in most Linux and Ubuntu and other Debian-based systems. In this tutorial we are going to review how to install and use the finger command on Linux.

Finger command syntax

The following command shows the syntax of the finger command:

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

Install finger

You can use the following command to install the 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 use the yum command to install or Download package.

$ sudo yum install finger

1) Finger command with option -s

With the -s option, the finger command prints the login name, real name, terminal name, and write status of the user (the asterisk in front of the terminal name means you do not have write permission for this device), idle time, login time, office location, and office phone number.

The login time is displayed in the format MM DD HH: mm. If the time exceeds six months, the year is displayed instead of the hours and minutes.

2) Finger command with option -l

The finger command with the -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, email status, and so on.

The expression “(messages off)” means that the user “harry” does not have write authorization for “root” on the devices pts / 4 and pts / 7. If a user is logged in more than once, the terminal information is repeated once per login.

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

3) Finger command with option -p

The -p option is the same as the -l option, except that it does not include users’ .plan, .project, and .pgpkey files in the returned result.

4) Finger command with option -m

With the -m option, the finger command prevents username matches in the returned result. All name comparisons carried out with the finger are not case-sensitive.

For example, our system has two users named “harry” and “harry1”. Without the -m option, the finger command returns information from both users and only returns information from user ‘harry’ when followed by -m.

With option -m

Without the -m option

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

If no arguments are given, finger prints an entry for each user currently logged on to the system.

diploma

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

Ubuntu Server Admin

Recent Posts

Advantech AOM-2721 is now Ubuntu Certified

Canonical announces that the Advantech AOM-2721 is officially joining the list of Ubuntu Certified Hardware.…

7 hours ago

Ruby and Rails Performance Roundup: The Backlog Edition

Yet again instead of tweets, a blog post. The backlog got out of hand -…

7 hours ago

How to Deploy OpenProject on Ubuntu VPS

This article provides a guide demonstrating how to deploy OpenProject on Ubuntu VPS. What is…

7 hours ago

Canonical integrates NVIDIA Nemotron 3.5 Lightning with Ubuntu for always-on AI agents

Canonical is pleased to announce that  NVIDIA’s newly introduced NVIDIA Nemotron 3.5 Lightning, an open,…

2 days ago

Xfwl4’s Second Preview Release

I’m pleased to announce the second preview release of xfwl4, Xfce’s Wayland compositor, version 4.21.1.…

2 days ago

How to Install, Secure, and Set Up MySQL on Ubuntu 26.04 LTS

If you have been using an ecommerce store to place online orders or have been…

3 days ago