The Wayback Machine - https://web.archive.org/web/20250303215253/https://www.geeksforgeeks.org/finger-command-in-linux-with-examples/
Open In App

Finger command in Linux with Examples

Last Updated : 11 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

The ‘finger’ command is a powerful utility in Linux used to display information about users logged into the system. This command is commonly used by system administrators to retrieve detailed user information, including login name, full name, idle time, login time, and sometimes the user’s email address. The ‘finger’ command offers more comprehensive details compared to the ‘pinky’ command, which is a lighter version with limited output.

Installing finger User Information Lookup Tool

To install ‘finger’ tool use the following commands as per your Linux distribution.

1. For Debian/Ubuntu

$sudo apt-get install finger

2. For CentOS/RedHat

$sudo yum install finger

3. For Fedora OS

$sudo dnf install finger

Working with finger User Information Lookup Tool

Once installed, the ‘finger’ command can be used to fetch detailed information about users on your Linux system. Here are some common ways to use this command:

1. Retrieving User Information

To get detailed information about a specific user, simply use the ‘finger’ command followed by the username.

$finger manav

Note: Here “manav” is the username.

To-finger-or-get-details-of-a-user

As can be seen, it displays the login name, name, directory, shell, login time, email, and plan of the user.

2. Checking Idle Status and Login Details

The ‘-s’ option provides a summary of the user’s details, including idle status, which is useful for tracking user activity.

$finger -s manav

To-get-idle-status-and-login-details-of-a-user

As can be seen, it displays the idle status along with the details of the user.

3. Suppressing Plan, PGP Key, and Project Information

If you want to avoid displaying the user’s plan, PGP key, and project details, use the ‘-p’ option.

$finger -p manav

To-avoid-printing-PGP-key-plan-and-project-details

As can be seen, it displays the login name, name, directory, shell, login time, email, but not the plan, PGP key, and project of the user.

4. Creating a Plan for a User

Users can set personal notes or a “plan” that will be displayed when the finger command is used. To create a plan, you can add text to the ‘.plan‘ file in the user’s home directory.

$echo "Plan details" > ~/.plan

To-create-a-plan-for-a-user

Now, after again using finger command it will display a plan for the user.

5. Creating a Project for a User

Similar to plans, users can also set a “project” that describes their current projects or tasks. This information is stored in the ‘.project’ file.

$echo "Project details" > ~/.project

To-create-a-project-for-a-user

Now, after again using finger command it will display a project for the user.

6. Adding a PGP Key for a User

Users can also include their PGP keys using the ‘.pgpkey’ file in their home directory. This is useful for sharing public keys through the ‘finger’ command.

$echo "pgpkey" > ~/.pgpkey

To-create-a-PGP-key-for-a-user

Now, after again using finger command it will display a PGP key for the user.

Conclusion

The ‘finger’ command is a handy tool in Linux for system administrators and users to see detailed information about user accounts. You can use it to check who is logged in, see when someone last logged in, view personal notes or projects, and manage user details. By learning how to use ‘finger’ and its options, you can easily keep track of user activity and manage your system better, making it easier for everyone to work together.

Finger command in Linux – FAQs

What does the ‘finger’ command do in Linux?

The ‘finger’ command shows detailed information about users on a Linux system, such as their login name, idle time, login time, home directory, and more.

How do I install the ‘finger’ command?

You can install finger using the package manager for your Linux distribution:

  • For Debian/Ubuntu: sudo apt-get install finger
  • For CentOS/RedHat: sudo yum install finger
  • For Fedora: sudo dnf install finger

What does the -s option do in the finger command?

The ‘-s’ option shows a summary of the user’s information, including idle status and login details:

finger -s username

How can I hide the plan, PGP key, and project details with ‘finger’?

Use the ‘-p’ option to display user information without the plan, PGP key, and project details:

finger -p username


    Master DevOps and also get 90% Course fee refund on completing 90% course in 90 days! Take the Three 90 Challenge today.

    The most sought-after Three 90 challenge has started and this is your chance to upskill and get 90% refund. What more motivation do you need? Start the challenge right away!


    Next Article

    Similar Reads

    Ccat – Colorize Cat Command Output command in Linux with Examples
    ccat is a Linux and macOS cat command that improved its precursor: the syntax highlighted file contents can be displayed with its help. Therefore, in the case of source code and configuration files, it is extremely helpful. It can highlight over 10 languages, like JavaScript, Java, Ruby, Python, Go, C, and JSON.Syntaxccat [OPTIONS] [FILE...]Basic U
    3 min read
    How to Display Command History in Linux | history Command
    The history command in Linux is one of the most essential tools especially for those who prefer working with the Linux terminal. This powerful command allows users to view, search, and manipulate the list of previously executed commands. Mastering the history command in Linux helps you efficiently reuse commands, automate repetitive tasks, and trou
    3 min read
    Tail command in Linux with examples
    It is the complementary of head command. The tail command, as the name implies, prints the last N number of data of the given input. By default, it prints the last 10 lines of the specified files. If more than one file name is provided then data from each file is preceded by its file name. Syntax of Tail Command in Linuxtail [OPTION]... [FILE]... L
    7 min read
    wc command in Linux with examples
    wc stands for word count. As the name implies, it is mainly used for counting purpose.It is used to find out number of lines, word count, byte and characters count in the files specified in the file arguments.By default it displays four-columnar output.First column shows number of lines present in a file specified, second column shows number of wor
    6 min read
    bc command in Linux with examples
    bc command is used for command line calculator. It is similar to basic calculator by using which we can do basic mathematical calculations. Arithmetic operations are the most basic in any kind of programming language. Linux or Unix operating system provides the bc command and expr command for doing arithmetic calculations. You can use these command
    11 min read
    AWK command in Unix/Linux with examples
    Awk is a scripting language used for manipulating data and generating reports. The awk command programming language requires no compiling and allows the user to use variables, numeric functions, string functions, and logical operators. Awk is a utility that enables a programmer to write tiny but effective programs in the form of statements that def
    8 min read
    Paste command in Linux with examples
    Paste command is one of the useful commands in Unix or Linux operating system. It is used to join files horizontally (parallel merging) by outputting lines consisting of lines from each file specified, separated by tab as delimiter, to the standard output. When no file is specified, or put dash ("-") instead of file name, paste reads from standard
    6 min read
    rm command in Linux with examples
    rm stands for remove here. rm command is used to remove objects such as files, directories, symbolic links and so on from the file system like UNIX. To be more precise, rm removes references to objects from the filesystem, where those objects might have had multiple references (for example, a file with two different names). By default, it does not
    5 min read
    uname command in Linux with Examples
    Linux, renowned for its open-source flexibility and powerful performance, offers a range of commands that reveal the inner workings of your system. Among these, the 'uname' command stands out as a versatile tool that provides key details about your Linux machine. Here, we will learn the basics of the 'uname' command, its various options, and how it
    4 min read
    cal command in Linux with Examples
    The 'cal' command in Linux is a versatile tool that displays calendars directly in the terminal. If a user wants a quick view of the calendar in the Linux terminal, 'cal' is the command for you. Here’s a look at the usage and features of 'cal' command in Linux.What is the 'cal' command?cal command is a calendar command in Linux which is used to see
    2 min read