Without 'users', if you just want a simple list of who's logged in, you have to run "w" or "who" and pipe it through awk, or cut or sed or whatever to extract the one piece of information you actually wanted. Well, your cpu may need the exercise, and we don't want sed, awk and cut to never get any attention (commands get rusty if not used frequently), but "users" is just what it says: folks logged in, only folks logged in, no extra info. If somebody is logged in more than once, you'll get them listed that many times. Nothing more to see folks, move along quietly.
I lied. There is more to it. It can actually take an optional argument, which is the name of a file it should read instead of the default /var/run/utmp. If you did "users /var/log/wtmp", you would (usually) get much more output - each name would be listed as many times as it had records in wtmp. I'm not sure how useful that would be, but there it is. You also might have, for reasons you choose not to discuss, copied utmp somewhere at some particular point in time and might run "users" with that file as its argument. Why? I don't know, you're the one who copied utmp!
But that's all there is to it. Really. Oh, OK, fine, there's a --version argument and --help. Sheesh, like that matters.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2012-07-17 Tony Lawrence
Security is mostly a superstition. It does not exist in nature, nor do the children of men as a whole experience it. Avoiding danger is no safer in the long run than outright exposure. Life is either a daring adventure, or nothing. (Helen Keller)