Beginners Guide for Logname Command on Linux
The logname command gives you the username of the currently logged-in user by reading the “/var/run/utmp” file, which is identical to the whoami command with one difference. Stick with this article to learn the difference between the logname and whoami commands, the usage of the