| Viewing this topic:
1 guest(s) viewing this topic
|How to Use the pinky Command on Linux by Kenyans247(m): Fri Jul 2019 10:04am|
Want to find out about the people logged on to your Linux computer? Well, don’t lift a finger; raise your pinky instead.
To discover some details about the people logged on to a Linux or Unix-like computer, many system administrators would likely turn to the finger command. Which is all well and good, but on many systems finger will be absent. It isn’t installed by default. You may well run across a system where this command is unavailable.
Instead of installing finger—assuming you have permission to do so—you can use pinky, a lightweight and modern version of finger. It was installed by default on all the Linux distributions tested during the research for this article, including Ubuntu, Manjaro, and Fedora.
A Delicate Touch
As you’d expect with a Linux command, pinky has its fair share of command line options (only two of which have names). But surprisingly, they all relate to pruning bits of information out of the reports that pinky produces. You can whittle the output down to include just the information of interest to you.
If pinky starts out as a lightweight, it can be positively featherweight by the time you’ve trimmed off the information you have no interest in.
The simplest way to use pinky is to type its name on the command line and hit Enter.
pinky in a terminal window
The default output is the “short format” report.
output from pinky in a terminal window
The short format report contains the following columns:
Login: The user name of the person who is logged in.
Name: The full name of the person, if known.
TTY: The type of terminal they are logged in at. This will usually be a pts (a pseudo-teletype). :0 means the physical keyboard and screen connected to this computer.
Idle: Idle time. This shows ?? if the person is running under an X-windows Display Manager, which does not provide that information.
When: The time and date when the person logged in.
Where: The location from which the person is 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 is sometimes unable to populate a column. It cannot put anything in a column if it doesn’t have that information. For example, the system administrator did not record 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 uses “dave” instead.
Reporting on a Single User
By default, pinky reports on every person that is logged in. To report on a single person, pass their user name to pinky on the command line.
pinky mary in a terminal window
As expected, pinky only reports on the person with the user name of “mary.”
Output from pinky in a terminal window
Omitting Column Headings
To remove the column headings from the short format report use the -f option.
output from pinky with -l and -b options in a terminal window
The column headings are removed from the report.
pinky output wioth no column headings in a terminal window
Omitting the Name Column
The -w option causes pinky to omit the “Name” column.
pinky -w alec
pinky -w alec in a terminal window
The resulting report has no “Name” column in it.
pinky report with no name column in a terminal window
Omitting the Name and Where Columns
The -i option cause pinky to omit both the “Name” and the “Where” columns.
pinky -i robert
pinky -i robert in a terminal window
The report from pinky no longer contains the “Name” and “Where” columns.
pinky report without name and where columns in a terminal widnow
Omitting the Name, Idle and Where Columns
To really strip things back, you can use the -q option to omit the “Name,” “Idle,” and “Where” columns.
pinky -q john
pinky -q john in a terminal window
pinky obediently removes the “Name,” “Idle,” and “Where” columns from the report. We’re down to three columns now. If we take anything else out, it’ll hardly be a report at all.
pinky report without name, idel and where columns in a terminal window
The Long Format Report
The -l (long format report) option causes pinky to increase the information provided on the individuals in the report. You must provide the name of a user account on the command line.
(This is one of the two command line options to be blessed with a name. The other is the -s (short format report) option. Because the default output is the short format report, the -s option doesn’t actually do anything.)
pinky -l mary
pinky -l mary in a terminal window
The long format report contains a few pieces of additional information.
extra information in the pinky report in a terminal window
The information provided in the long format report is:
Login name: The user name of the person who is logged in.
In real life: The full name of the person, if known.
Directory: This person’s home directory.
Shell: The shell 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 hold a short description of the project or work item a computer user was engaged on. Likewise, the contents of their ~/.plan file would be a short description of the actual work item for that project. It allowed managers and interested parties to see what work an individual was occupied with, and which project that work belonged to. This scheme is rarely used nowadays. These fields are likely to be blank for the vast majority of people.
Let’s look at Alec:
pinky -l alec
pinky -l alec
Alec has neither a ~/.plan file nor a ~./project file.
long format output from pinky for user with no plan nor project file in a terminal window
Omitting the Directory and Shell Line
To omit the line reporting on the home directory and the shell from the long format report, use the -b option.
pinky -l -b robert
pinky -l -b robert in a terminal window
The line reporting on the home directory and shell is removed from the report.
pinky report with no directory and shell line in a terminal window
Omitting the Project File
To have the project line omitted from the long format report, use the -h option.
pinky -l -h mary
pinky -l -p mary in a terminal window
The contents of the ~/.project file are not reported on.
pinky long format report without the project file in a terminal window
Omitting the Plan File
To have the plan line omitted from the long format report, use the -p option.
pinky -l -p mary
pinky -l -p mary in a terminal window
The contents of the ~/.plan file are not reported on.
pink report with the plan file omitted in a terminal window
Why All the Omit Options?
Why might a command that generates reports have so many options to remove bits of information? It allows you to focus on the information that you really want. So you have options to separate the wheat from the chaff. And you get to decide which is which.
LIVE KENYAN RADIO
WATCH KENYAN TV
Sections: Career, Properties, Family, Health, Food, Webmasters, Programing, Universities, Computers, Education, Fashion, Social Media/K247 Chit-Chat, Theatre/Comedy, Gaming, Poetry, Burundi Forum, Somalia Forum, Rwanda Forum, Tanzania Forum, Ugandan Forum,Kenyans247 - Copyright © 2019 Sande Kennedy. All rights reserved. See How To Advertise.
Disclaimer: Every Kenyans247 member is solely responsible for anything that he/she posts or uploads on Kenyans247.