Inspect Logged-in Users with pinky Without Guessing
You will use pinky to inspect login sessions, narrow the output when you need a quick answer, and query a named account without mistaking an empty result for an error. Allow about ten minutes. The examples describe GNU coreutils 9.4, installed here as package coreutils 9.4-3ubuntu6.3.
The route
Jump straight to the step you need, or tick off Done means at the end.
This is a read-only workflow. It does not log users out, edit account files or change services, so it normally needs no elevated privileges.
1. Check the installed command
Confirm that the shell will run the expected binary and record its version:
$ command -v pinky
/usr/bin/pinky
$ pinky --version
pinky (GNU coreutils) 9.4
$ dpkg-query -W -f='${Package} ${Version}\n' coreutils
coreutils 9.4-3ubuntu6.3
The manual describes pinky as a lightweight finger program. It reads the login-session database at /var/run/utmp. That means its answer is about sessions currently recorded by this host, not a complete list of local accounts.
Checkpoint
If command -v finds nothing, install the distribution's coreutils package using your normal package-management process. Do not work around a missing command by copying a binary from another machine.
2. List current sessions in the default format
Run pinky with no user name:
$ pinky
Login Name TTY Idle When Where
ACCOUNT Full Name pts/1 00:04 2026-09-26 09:15 terminal-host
Your rows and timestamps will differ. The columns identify the login name, the account's full name when available, terminal, idle time, login time and remote host or terminal origin. A host with no recorded sessions may show only the headings, or no useful rows.
The default is short format. The command does not promise that every field is populated: a missing full name, remote host or idle value can simply mean that the underlying account or session data has no value for it.
3. Reduce the output for a quick session check
Use -q when you only need the login name, terminal and login time. It omits the full name, remote host and idle time:
$ pinky -q
Login TTY When
ACCOUNT pts/1 2026-09-26 09:15
This is useful in a script or during a quick operational check because it removes fields that can be blank or distracting. It still reports sessions from the host's utmp data; it does not query a directory service or prove that an account is currently using the terminal.
Other short-format reductions are available when you need a particular shape. -f removes the headings, -w removes the full name, and -i removes both the full name and remote host. Prefer the named option that matches the data you actually need rather than trimming columns with a fragile text pipeline.
4. Query one account, then interpret an empty result
Pass a real login name after the options:
$ pinky ACCOUNT
Login Name TTY Idle When Where
ACCOUNT Full Name pts/1 00:04 2026-09-26 09:15 terminal-host
Replace ACCOUNT with a name that exists on your host. If that account has no current session, the command can print the headings without a row. In the installed GNU coreutils version, an unknown or inactive name does not turn this into a useful account-existence test: an empty table is the result to investigate.
Check the exit status separately:
$ pinky ACCOUNT > /tmp/pinky-output
$ status=$?
$ printf 'pinky exit status: %s\n' "$status"
pinky exit status: 0
$ sed -n '1,5p' /tmp/pinky-output
This separates command failure from a valid query that found no matching session. The temporary file is ordinary output, not a system configuration file. Remove it after checking if it contains information you do not want to retain:
$ rm -- /tmp/pinky-output
That removal is irreversible, but it affects only the temporary file created by the example.
5. Request long details only with a named user
Use -l when you need the long form for one or more named users:
$ pinky -l ACCOUNT
Login name: ACCOUNT
Directory: /home/ACCOUNT
Shell: /bin/bash
On since: 2026-09-26 09:15 on pts/1 from terminal-host
No mail.
No plan.
The exact fields and values depend on the account and its session. The long form can include the home directory and shell, plus information from the user's project and plan files. It is not a request for every local account: it describes the named user or users.
A common trap is running pinky -l without a user. The installed command rejects that usage with a message saying that at least one user name is required. Add an explicit name, or use the default short listing if you want current sessions.
Long format options -b, -h and -p omit the home directory and shell, project file, and plan file respectively. These options do not create or remove those files; they only suppress fields in the displayed report.
6. Diagnose the usual distractions
If output appears empty, first check whether you asked for a named user who is currently logged in. Then compare it with pinky -q without a name. If the default listing has sessions but the named query does not, check the spelling and account name.
Do not treat pinky as a security audit. Its data comes from /var/run/utmp, so stale, incomplete or locally managed session records can affect what you see. The command also does not show all accounts, failed logins or historical logins. Use an audit or authentication-log tool for those jobs.
Do not add sudo by habit. Reading the normal session listing should be unprivileged. If a local permission policy prevents access to the session database, investigate that policy rather than broadening privileges for a quick report.
Done means
pinky --versionidentifies the GNU coreutils version you are relying on.pinkylists the host's current recorded sessions in short format.pinky -qgives a compact login, terminal and time view when that is all you need.- A named query is interpreted as a session lookup, not an account-existence or history check.
pinky -lis used with an explicit user name, and any temporary output file has been removed when no longer needed.