Check Linux Logged-In User Info
To check the information of the current logged-in user, you can use the “who” command. This command will display relevant information of users currently logged into the system, including username, terminal device, login time, etc.
To find information about the current logged-in user, simply enter the following command in the terminal:
who
After executing the command, the information of the currently logged-in user will be displayed, for example:
username1 tty1 2022-01-01 10:00 (:0)
username2 pts/0 2022-01-01 11:30 (:1)
The above output shows that there are two users logged into the system. The first column represents the username, the second column represents the terminal device or pseudo-terminal device, the third column represents the login time and date, and the last column represents the login source.
Please note that the output results may vary due to system configuration, permissions, and other factors.