Current User in Shell

Level 16 keystrokes

whoami displays the username of the current user.

Shell code

# Prints the name of the effective user running the shell (here: user)
# Run through sudo (sudo whoami) it prints root
1whoami

Output

user
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

More Shell examples at level 1

← Shell typing practice