What Is Difference Between Whoami And Logname Commands?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The whoami command will output the user name of the current user, while the logname command will output the login name of the current user.
The ‘whoami’ command displays the current user logged into the system, while the ‘logname’ command displays the login name of the current user.
The whoami command prints the username of the current user, that is, the user that is currently logged in. The logname command prints the username of the user that is currently logged in, but does not check for any other information. It simply prints the username of the current user.