قالب وردپرس درنا توس
Home / Tips and Tricks / How to Use the pinky Command on Linux

How to Use the pinky Command on Linux



  Linux laptop with an Ubuntu desktop
Fatmawati Achmad Zaenuri / Shutterstock.com

Want to know more about the people logged into your Linux computer? Well, do not lift a finger ; Instead, increase your little finger .

Many system administrators would likely turn to the finger command to get some details about the people logged in to a Linux or Unix-like computer. What's all well and good, but on many systems finger will be missing. It is not installed by default. You may be running on a system where this command is not available.

Instead of installing finger ̵

1; assuming you have permission to do so – you can use pinky a light and modern command version of finger. It was installed by default on all Linux distributions tested during the research for this article, including Ubuntu, Manjaro, and Fedora.

A Tender Touch

As you would expect from a Linux command, Pinky has a fair share of command-line options (only two of which have names). But, surprisingly, all refer to the trimming of information from the reports that created pinky . You can reduce the output to include only the information of interest to you.

If pinky starts as a lightweight, it may not be interested in having a positive spring weight by the time you've cut off the information.

Using pinky

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

  pinky 

  pinky in a terminal window

The standard edition is the short format report.

 Pinky output in a terminal window

The short format report contains the following columns:

  • Login: The username of the person who is logged in.
  • Name: The full name of the person, if known.
  • TTY: The type of terminal to which it is logged. This is usually a dot (a pseudo-teletype). : 0 means that the physical keyboard and the physical screen are connected to this computer.
  • Idle: Idle time. This shows ????? If the person is running an X-Windows Display Manager that does not provide this information.
  • When: Time and date of registration of the person.
  • Where: Where the person is logged in. This is often the IP address of a remote computer. Entering ": 0" means that the physical keyboard and the physical screen are connected to the Linux computer.

pinky sometimes can not fill a column. It can not insert anything into a column if this information does not exist. For example, the system administrator did not record the full name of the person with the Dave user account. Obviously, pinky can not display a full name in the "Name" column and uses "Dave" instead.

Reporting for a Single User

By default, pinky reports each person logged in. To create a report for a single person, pass your username to pinky . in the command line.

  Pinky Mary 

  Pinky Mary in a terminal window

As expected Pinky reports only about the person with the username "Mary" [19659004]   issue of Pinky in a terminal window

Omitting column headings

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

  pinky -f 

  Output of pinky with the options -l and -b in a terminal window

The column headers are removed from fr From the report.

 Pinky output without column headings in a terminal window

Omitting the Name Column

The option -w causes Pinky ] around the column "Name "to leave out.

  pinky -w alec 

  pinky -w alec in a terminal window

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

 pinky report with no name column in a terminal window

Omitting the Name and Wo Columns

The option -i initiates pinky both To omit names "And the" where "columns.

  pinky -i robert 

  pinky -i robert in a terminal window

The report from pinky no longer contains the" name

 Pinky Report with No Names and Where Columns in a Terminal Widnow

Leaving Name, Idle, and Where Columns

To really be you to undo the elements, 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, and now we have only three i columns. If we take something else out, it will hardly be a report.

 small report with no name, idle and where columns in a terminal window

The Long Format Report

The option -l (long format report) initiates pinky to increase the information on persons given in the report . You must enter the name of a user account on the command line.

(This is one of the two command-line options that are blessed with a name.) The other option is the report -s (short format report)) Since the standard output is the short report, the option - s does not really matter.)

  pinky -l mary 

  pinky -l mary in a terminal window

The long format report contains some additional information.

 Additional Information in the Pinky Report in a Terminal Window

The information in the Long Format Report is: [19659016] Login Name: The username of the person who is logged in.

  • In real life: The full name of the person, if known.
  • Directory: The home of this person directory.
  • Shell: The shell that uses this person.
  • Project: The content of this person's ~ / .project file, if it exists.
  • Plan: The content of this person's ~ / .plan file, if any.
  • The idea behind the ~ / .project file was that it should contain a brief description of the project or work item a computer user was dealing with. Similarly, the contents of your ~ / .plan file would be a brief description of the actual work item for this project. Managers and prospects were able to see what kind of work a person was employed and to which project this work belonged. This scheme is rarely used nowadays. These fields are probably empty for the vast majority of people.

    Let's look at Alec:

      pinky -l alec 

      pinky -l alec

    Alec has neither a ~ / .plan file or ~. / Project file.

     Long format output by pinky for users without a plan or project file in a terminal window.

    Omitting the Directory and Shell Lines

    Use the -b option in the long format report to log the base directory and shell.

      pinky -l -b robert 

      pinky -l -b robert in a terminal window

    The row for the home directory and shell has been removed from the report.

     Pinky report without a directory and shell line in a terminal window

    Dropping the project file [19659007] To hide the project line from the long format report, use the option -h .

      pinky -l -h mary 

      pinky -l -p mary in a terminal window

    The contents of the ~ / .project file are not reported.

     Short long format report without the project file in a terminal window

    Omitting the plan file

    Use the option -p to hide the plan line from the long format report.

      pinky -l -p Mary 

      pinky -l -p Mary in a Terminal Window

    The contents of the ~ / .plan file are not reported.

     Pink report with the plan file omitted in a terminal window.

    Why all omission options? [19659007] Why does a command that generates reports possibly have so many information removal options? You can focus on the information you really want. So you have the opportunity to separate the wheat from the chaff. And you can decide which one is.




    Source link