What is the difference between the whoami and logname commands?
whoami shows you who logged in as initially, and logname shows who are you currently.
logname specifies the name of the login log file, and whoami prints the logged in username.
whoami tells who are you currently, and logname tells who you were when you logged in initially.
whoami and logname provide the same information.