Ubuntu: “who” command - How to show IP address



Question:

I would like to know if there is an option to get the IP address of loged users with who command?

When I type who I get this:

wolfy@wolfy-server:~$ who

wolfy pts/0 2012-06-01 09:43 (tzu-23-764-657.sta.als.some.net)

I would like to replace "tzu-23-764-657.sta.als.some.net" with a real IP address, like in "last" command:

wolfy@wolfy-server:~$ last -i

wolfy pts/0 123.123.123.123 Fri Jun 1 09:43 still logged in

I did not find any options to do that... do you know a way to do this... maybe a different command?


Solution:1

You can use the --ips switch.

To quote the manual:

--ips

Print ips instead of hostnames. With --lookup, canonicalizes based on stored IP, if available, rather than stored hostname.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »