Can I change the output of whoami?

QuestionsQuestions8 SkillsProYour First Linux LabOct, 21 2025
0127

No, you cannot change the output of the whoami command directly. The whoami command retrieves the username of the currently logged-in user from the system, and it reflects the actual user account under which the terminal session is running.

If you want to change the output, you would need to switch to a different user account using the su (switch user) command or log in as a different user. For example:

su - username

After entering the correct password, running whoami will then display the new username. However, the output itself is determined by the system and cannot be altered by the user.

0 Comments

no data
Be the first to share your comment!