Want to know who is connected to your Linux computer? Well, do not lift your finger; Raise your little finger instead.
To find out some details about people connected to a Linux or Unix computer, many system administrators would probably turn to the finger. order. Which is good, but on many systems, the finger will be missing. It is not installed by default. You can very well run a system on which this command is not available.
Instead of installing finger (assuming you have permission to do so), you can use pinky, a light and modern version on point. It was installed by default on all tested Linux distributions when searching for this article, including Ubuntu, Manjaro, and Fedora.
A delicate touch
As expected with a Linux command, pinky has its fair share of command line options (only two have a name). But, surprisingly, they all relate to the removal of items of information in reports produced by pinky. You can reduce the output to include only the information that interests you.
If Pinky starts as a featherweight, he can become really featherweight by the time you've deleted information that you do not care about.
Use the little finger
The easiest way to use pinky is to type his name on the command line and press Enter.
The default output is the "short format" report.
The short format report contains the following columns:
S & # 39; identify: The user name of the person who is logged on.
First name: The full name of the person, if known.
TTY: The type of terminal to which they are connected. This will usually be a pts (a pseudo-teletype). : 0 means the physical keyboard and the screen connected to this computer.
Idle: Time of inactivity. This shows ????? if the person runs under an X-windows display manager, that does not provide this information.
When: The time and date when the person is connected.
Or: Location from which the person is connected. This is often the IP address of a remote computer. An entry of ": 0" means the physical keyboard and the screen connected to the Linux computer.
pinky is sometimes unable to fill a column. He can not put anything in a column if he does not have this information. For example, the system administrator did not register the full name of the person who has the user account called "dave". Obviously, pinky can not display a full name in the Name column and instead uses "dave".
Reporting on a single user
By default, pinky reports all connected people. To report a single person, pass his or her user name to pinky on the command line.
As expected, pinky only reports the person with the "mary" user name.
Omit column headers
To remove the column headers from the short format report, use the -f option.
Column headers are removed from the report.
Omit the Name column
The -w option makes pinky omit the "Name" column.
pinky -w alec
The resulting report does not contain a "Name" column.
Omit the Name and Where columns
The -i option allows pinky to omit the "Name" and "Where" columns.
The pinky report no longer contains the "Name" and "Where" columns.
Omit the Name, Idle and Where columns
To really delete items, you can use the -q option to omit the "Name", "Inactive", and "Where" columns.
pinky -q john
pinky obediently removes the "Name", "Inactive" and "Where" columns from the report. We are three columns now. If we take something else, it will hardly be a report.
The long format report
The option -l (long format report) allows Pinky to increase the information provided about 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 assign to a name.) The other option is the option -s (short format report) .As the default report is the short format report, the option -s does nothing …
pinky -l mary
The long format report contains some additional information.
The information provided in the long format report is as follows:
Username: The user name of the person who is logged on.
In real life: The full name of the person, if known.
Directory: Personal directory of this person.
Shell: The shell that this person uses.
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 had to be used to contain a brief description of the project or work item on which a user of a computer was engaged. Likewise, the content of their ~ / .plan file would be a brief description of the actual work item of this project. This allowed managers and stakeholders to see what work a person was doing and what project that work was. This scheme is rarely used today. These fields are likely to be empty for the vast majority of people.
Let's look at Alec:
pinky -l alec
Alec has no ~ / .plan file or file ~. / Project.
Omit directory and shell line
To omit the line reports on the home directory and shell of the long format report, use the -b option.
pinky -l -b robert
The report line on the home directory and the shell is removed from the report.
Omit the project file
For the project line to be omitted from the long format report, use the -h option.
pinky -l -h mary
The content of the ~ / .project file is not the subject of a report.
Omit the plan file
For the outline line to be omitted from the long format report, use the -p option.
pinky -l -p mary
The content of the ~ / .plan file is not reported.
Why all the options for omission?
Why can a command that generates reports have so many options for deleting information? This allows you to focus on the information you really want. So you have the opportunity to separate the wheat from the chaff. And you decide which one is which.