Tag Archives: user

who and whoami: Two more quick Five Ws

After the rampant indecision of whatis, whereis and which, even more uncertainty is addressed by who and whoami.

Only this time, there’s a better sense of uniformity between the two. But that should also be expected, since both who and whoami are part of that magical package called coreutils. Regardless, this will be quick.

who, as you might imagine, shows users logged in at the moment, when they signed in, and from what console.

kmandla@6m47421: ~$ who
kmandla  tty1         2014-06-28 05:08

who can show a little more information, which is probably a good idea.

kmandla@6m47421: ~$ who -a -H
NAME       LINE         TIME             IDLE          PID COMMENT  EXIT
           system boot  2014-06-28 05:08
kmandla  - tty1         2014-06-28 05:08 08:02         180

In this case, the -a flag prods who for the most information available, and the -H supplies the header line. So you know what you’re looking at, of course. πŸ˜‰

whoami, in case you thought it impossible, is even simpler. It only does one thing — reminds you who you are — and its only options are --version and --help … and --help isn’t hard to figure out.

kmandla@6m47421: ~$ whoami

As if I didn’t know that. O_o

I debated leaving these tools out, since they’re from the same package and the latter one is hardly worth mentioning. But you never know, perhaps this post will help someone with their identity crisis some day. … :mrgreen:

finger: Insert off-color joke here

I have any number of improper puns I could use here, to introduce finger. But what strikes me more than the potential to be marginally rude, is the fact that in both Arch and Debian, finger is not installed by default.

Maybe that was always the case, but I could swear years ago in Ubuntu, finger was included in some such or other package, and installed as part of the base system.


Maybe that’s just my memory skipping a rail, but it’s in Arch as netkit-bsd-finger, and in Wheezy as just finger.

I don’t think any less of finger for being thrown out of the default arrangement. There are other user polling tools available, some of which we will see in the years to come.

Either way, for fun and profit, you can see some statistics on your system’s users with just a simple finger kmandla -s or finger kmandla -l. No doubt system administrators would find that useful.

I feel obligated to mention that I occasionally see cautions against using finger, because it’s an opportunity for an attacker to get a user’s information by randomly throwing out potential names.

There are some safeguards against that — I think the .nofinger file helps prevent this — so if you’re worried about finger, but need it for a system, be aware of the risks.

And with that, I will successfully close this post without any lame finger jokes. Ta-da! :mrgreen: