In this article we will show you the code to get who is logged in to your windows, linux, mac or Ubuntu operating system. Use
whoami command in terminal to get the username of currently logged in user.
Code Example –
[email protected]: whoami akash
Run this command in Ubuntu or any other linux based operating system. The same command will work on MacOs too. For windows, run this command in WSL.