Bash One-Liner Script To Produce Somewhat-Fancy Output Of Who's Logged In | Linux Today

Bash One-Liner Script To Produce Somewhat-Fancy Output Of Who’s Logged In

Written By
Web Webster
Web Webster
Nov 20, 2008

[ Thanks to Mike
Golvach
for this link. ]

“That is, as I’ve always understood, one of the main
reasons to script things out in the first place. The other reasons,
like automation, efficiency, etc, are pretty much ignored here,
even though we will be automating a repetitive action and that, by
definition, will make our waste of company time more efficient. No
matter how you look at them, automation and efficiency always seem
to be a good thing 😉

“This “script” is really just a simple pipe-slam so that we can
figure out who’s on the machine with us (my preference is for a
script, but – as you’ll soon see – this could just as easily be an
alias, etc). Sure, we could just type “w” or “who,” (and “w” does
form the base of this bash one-liner script), but we’d like to have
this whole thing look more personal. And by personal, I mean, we’d
like to know who else is on other than us by UID or login name. The
functionality (or relative merit) of this script depends heavily on
the way in which users were created on your machine in the first
place. If no “comment” (or “gecos”) field is populated for users on
your system, this command-chain is completely worthless.”


Complete Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.