Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

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.