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:

Sponsored
class="wp-block-preformatted">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.

Sponsored

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

How is Livepatch safeguarded against bad actors?

Canonical Livepatch is a security patching automation tool which supports reboot-less security updates for the…

3 hours ago

Accelerating data science with Apache Spark and GPUs

Apache Spark has always been very well known for distributing computation among multiple nodes using…

3 hours ago

Cut data center energy costs with bare metal automation

Data centers are popping up everywhere. With the rapid growth of AI, cloud services, streaming…

1 day ago

Build the future of *craft: announcing Starcraft Bounties!

Our commitment to building a thriving open source community is stronger than ever. We believe…

1 day ago

NodeJS 18 LTS EOL extended from April 2025 to May 2032 on Ubuntu

The clock was ticking: Node.js 18’s upstream End of Life (EOL) The OpenJS Foundation is…

1 day ago

Native integration now available for Pure Storage and Canonical LXD

June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…

2 days ago