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:
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.