- The output of
who am ican be useful to get the origin of a user login.
For example, this command prints from which IP the user logged in:
who am i | sed -e "s/^.*(//" -e "s/)$//" 192.168.122.1
The issue in this case is that the command
who am idoes not print any output:
who am i <nothing>
- Red Hat Enterprise Linux
- login utmp
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.