How to use the pinky command in Linux

To discover some details about people who log in to a Linux or Unix computer, is the pinky command. But many system administrators will probably resort to the finger command. Which is fine, but in many systems it will be absent. It is not installed by default.

So you can work in a system where this command is not available. Instead of installing finger, assuming you have permission to do so, you can use the pinky command. Which is a light and modern version of finger. It was installed by default on all Linux distributions, including Ubuntu, Manjaro and Fedora.

Pinky command: a delicate touch

As expected with a Linux command, the pinky command has a good amount of command line options; Only two of which have names. But, surprisingly, all of them related to the bits of information outside the reports that pinky produces. So you can reduce production to include only the information that interests you.

If pinky starts as a light weight, it can be a positive featherweight by the time you cut out the information you don't care about.

Using the pinky command

The easiest way to use pinky is to type your name on the command line and press Enter.

pinky

The default result is the "short format" report.

The short format report contains the following columns:

  • Login: the username of the person who has logged in.
  • Name: the full name of the person, if known.
  • TTY: the type of terminal they are connected to. This will usually be a pts (a pseudo teletype). : 0 means the physical keyboard and screen connected to this computer.
  • Inactive: Inactive time. This shows ????? If the person is running under an X-windows Display Manager, it does not provide that information.
  • When: the time and date the person logged in.
  • Where: the location from which the person has logged in. Often, this will be the IP address of a remote computer. An entry of ": 0" means the physical keyboard and screen connected to the Linux computer.

Pinky sometimes can't fill a column. You can't put anything in a column if you don't have that information. For example, the system administrator did not register the full name of the person who owns the user account called «dave». Obviously, pinky cannot display a full name in the Name column, and instead uses «dave».

Report on a single user

By default, pinky informs about each person who has logged in. To report a single person, pass your username by pinky on the command line.

pinky mary

As expected, pinky only reports on the person with the username "Mary."

Skip column headers

To remove column headings from the short format report, use the -f option

pinky -f

Column headers are removed from the report.

Skip the name column

The -w option causes pinky to skip the "Name" column.

pinky -w alec

The resulting report does not have a "Name" column.

Skip the name and column "where"

The -i option causes pinky to omit the "Name" and "Where" columns.

pinky -i robert

Pinky's report no longer contains the "Name" and "Where" columns.

Skip columns name, inactive and where

To undo things, you can use the -q option to skip the columns «Name», «Inactive» and «Where».

pinky -q john

pinky dutifully removes the columns "Name", "Inactive" and "Where" from the report. Now we have three columns. If we get something else, it will hardly be a report.

The long format report that throws the pinky command

The -l (long format report) option causes pinky to increase the information provided about the people in the report. You must provide the name of a user account on the command line.

This is one of two command line options to throw a name. The other is the -s option (short format report). Because the default output is the short format report, the -s option doesn't really do anything.

pinky -l mary

The long format report contains some pieces of additional information.

The information provided in the long format report is:

  • Login Name: The username of the person who logged in.
  • In real life: the person's full name, if known.
  • Directory: the home directory of this person.
  • Shell: The shell that this person is using.
  • Project: The contents of this person's ~ / .project file, if it exists.
  • Plan: the contents of this person's ~ / .plan file, if it exists.

The idea behind the ~ / .project file was that it should be used to contain a brief description of the project or work item in which a computer user was involved. Similarly, the contents of the ~ / .plan file would be a brief description of the actual work item for that same project.

It allowed administrators and stakeholders to see what job an individual was busy with and what project that job belonged to. This scheme is rarely used today, so these fields are likely to be blank for the vast majority of people.

Let's look at the "Alec" example again:

pinky -l alec

As you will see, "Alec" does not have a ~ / .plan file or a ~. / Project file.

Skip the directory and shell line

To skip the line report in the home directory and the long format report shell, you must use the -b option.

pinky -l -b robert

The line that reports the home directory and the shell is removed from the report.

Skip the project file

To omit the project line from the long format report, use the -h option.

pinky -l -h mary

As you will see, you don't have information about the contents of the ~ / .project file.

Skip the plan file

To skip the long format report plan line, use the -p option.

pinky -l -p mary

You will not see information about the contents of the ~ / .plan file.

Why use all skip options with the pinky command?

Why can a report generating command have so many options to remove pieces of information? It is because it allows you to concentrate on the information you really want. Then you have options to separate the wheat from the straw and you can decide which is which.