Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to find out which machine I have logged in to my current terminal from. But "who -m" does not work. It does on Linux, but not on Solaris. Any ideas what I might be doing wrong?

myhost2:/home/myuser> who
myuser   pts/1        Aug  9 07:35   (
myuser   pts/2        Aug  9 08:42   (
myuser   pts/3        Aug  9 08:42   (

myhost2:/home/myuser> who -m
myuser   pts/2        Aug  9 08:42

myhost2:/home/myuser> who am i
myuser   pts/2        Aug  9 08:42

myhost2:/home/myuser> which who

myhost2:/home/myuser> alias who
who: alias not found

myhost2:/home/myuser> uname -a
SunOS myhost2 5.10 Generic_138889-08 i86pc i386 i86pc

myhost2:/home/myuser> tty

myhost2:/home/myuser> TTY=$(tty | cut -c 6-);who | grep "$TTY " | awk '{print $6}' | tr -d '()'
share|improve this question

A Solaris 10 box here seems to do the right thing:

$ uname -srv
SunOS 5.10 Generic_138889-08

$ who -m
myuser     pts/2        Aug  9 10:00    (

Might this be dependent on how you are logging into the Solaris box? SSH / Telnet / XTerm ?

share|improve this answer
That's interesting. I'm using putty SSH. It's strange that "who" shows me my machine, but "who -m" doesn't. – dogbane Aug 9 '10 at 10:55
Hmm. PuTTY here too. And of course the general "who" and "who -a" show the connecting host. – njd Aug 9 '10 at 15:57
who is probably an alias, which may be why who -m misbehaves. alias who will show you if it is an alias. – jim mcnamara Aug 10 '10 at 21:34
nope, who is not an alias. Even the fully qualified command "/usr/bin/who -m" produces the same output. – dogbane Aug 11 '10 at 9:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.