pinky Command in Linux



The pinky command in Linux provides information about system users in a simplified and more concise format. It is a lightweight version of the finger command, another tool to retrieve detailed information about system users.

The pinky command displays details such as usernames, terminals, login times, and hostnames of currently logged-in users.

Table of Contents

Here is a comprehensive guide to the options available with the pinky command −

Syntax of pinky Command

The syntax of the Linux pinky command is as follows −

pinky [options] [user]

In the above command, the [options] field is used to change the command's output behavior. The [user] field is used to specify the user's name whose information is required to be shown.

pinky Command Options

The options for the pinky command are listed below −

Option Description
-l Produce long format output for the specified user/users
-b Skip the user's home directory and shell in long format
-h Skip the user's project file in long format
-p Skip the user's plan file in long format
-s Do short format output (this is the default)
-f Skip the line of column headings in a short format
-w Skip the user's full name in a short format
-i Skip the user's full name and remote host in short format
-q Skip the user's full name, remote host, and idle time in a short format
--help Display the help
--version Output version information

Examples of pinky Command in Linux

This section demonstrates the usage of the pinky command in Linux with examples −

Listing all Logged-in Users

To list all the logged-in users, use the pinky command without any option −

pinky
pinky Command in Linux1

Displaying a Specific User in a Long Format

To display the information of a specific user in the long format, use the -l option −

pinky -l alex
pinky Command in Linux2

For multiple, users, use the pinky command in the following way −

pinky -l alex sam

Displaying Logged-in Users without the Home Directory

To display logged-in users without showing their home directories in long format, use the -b option −

pinky -l -b alex
pinky Command in Linux3

Displaying Logged-in Users without the Project File

To display the logged-in users without their project file in long format, use the -h option with -l

pinky -l -h alex
pinky Command in Linux4

Displaying Logged-in Users without the Column Headings

To display the logged-in users without the column headings, use the -f option −

pinky -f
pinky Command in Linux5

Listing Logged-in Users without the Full Name

To display the logged-in users without the full name, use the -w option −

pinky -w
pinky Command in Linux6

Listing Logged-in Users without the Full Name and Remote Host

To display the logged-in users without the full name and remote host, use the -i option −

pinky -i
pinky Command in Linux7

Listing Logged-in Users without the Full Name, Remote Host, and Idle Time

To display all logged-in users without their full names, remote hosts, and idle time, use the -q option −

pinky -q
pinky Command in Linux8

Displaying Usage Help

To display the usage help of the pinky command, use the --help option −

pinky --help

Conclusion

The pinky command in Linux provides a concise way to view system user information, serving as an alternative to the finger command. It supports various options to customize the output, such as displaying detailed user information, omitting specific fields, or using short formats.

In this tutorial, we provided examples of the pinky command to illustrate its usage, including listing logged-in users, filtering data like home directories or project files, and displaying usage help or version details.

Advertisements