Operating System - HP-UX
1753394 Members
6953 Online
108792 Solutions
New Discussion

"who am i -R" HP-UX command in Linux

 
Xcorpius
New Member

"who am i -R" HP-UX command in Linux

Hi,

 

Does anyone know the equivalent of the HP-UX "who am i -R" command in Linux? 

 

The option -R in HP-UX:

           -R             Displays the user's host name.  If the user is
                          logged in on a tty, who displays the string
                          returned from gethostname() (see gethostname(2)).
                          If the user is not logged in on a tty and the host
                          name stored in the utmps database or named utmp
                          like file has not been truncated when stored
                          (meaning that the entire host name was stored with
                          no loss of information), it is displayed as it was
                          stored.  Otherwise, the gethostbyaddr() (IPv4) or
                          getipnodebyaddr() (IPv6) function is called with
                          the internet address of the host (see
                          gethostent(3N)).  The host name returned by
                          gethostbyaddr() (IPv4) or getipnodebyaddr() (IPv6)
                          is displayed unless it returns an error, in which
                          case the truncated host name is displayed.

 

But on Linux I can't find any equivalent parameter.

 

Thanks!!!

2 REPLIES 2
Steven Schweda
Honored Contributor

Re: "who am i -R" HP-UX command in Linux

> [...] in Linux?

   "Linux"?  _Which_ "Linux"?  Possibly more relevant/appropriate:

      https://community.hpe.com/t5/Linux-General/bd-p/itrc-15

> [...] Displays the user's host name. [...]

   If you want the host name, what's wrong with "hostname"?

      man hostname

   On a system which has multiple network interfaces, each one might
have a different (DNS) name.  Is there some actual problem which you are
trying to solve?

mbarnwal
HPE Pro

Re: "who am i -R" HP-UX command in Linux

"who am i -u" shows the hosname from where the user is logged in. It works same way in HP-UX and Linux.

Regards

Manish

I am a HPE Employee