Check your username with the whoami command

The fastest way to see your Ubuntu username is to open a terminal and type whoami, then press Enter. The system prints your username on the next line. This command works whether you are logged in as a regular user or have switched to a different account, and it shows only the active username at that moment.

If you are new to the terminal, open Ubuntu's Activities menu, search for "Terminal", and click it. Type whoami exactly as shown, with no capital letters or spaces, then press Enter. The username appears when ready below.

Key Takeaways

  • The whoami command in a terminal shows your current Ubuntu username in one line.
  • Your username also appears in the system settings under Users, where you can see all accounts on the machine.
  • The home folder path always contains your username — for example, /home/james means your username is james.
  • If you have switched user accounts with su or sudo, whoami shows which account is currently active.

Find your username in system settings

You can also see your username without opening a terminal. Click the system menu in the top-right corner of your screen (usually a power icon or your account icon), then select "Settings". In the left sidebar, click "Users". Your account is listed with your username displayed next to your profile picture.

This method shows all user accounts on your Ubuntu machine, not just the one you are logged into. If you have multiple accounts, each one is listed separately. This is useful if you need to remember a username you use less often or if you are setting up permissions for another user.

Look at your home folder path

Your username is also built into the path to your home folder. Open the file manager and look at the location bar at the top. If the path shows /home/sarah, your username is sarah. If it shows /home/james, your username is james. The part after /home/ is always your username.

You can also see this in a terminal by typing pwd (print working directory) when you first open it. The terminal usually starts in your home folder, so the path displayed will contain your username. This method works even if you are not sure how to navigate the file manager.

Check the command prompt in your terminal

When you open a terminal, the prompt at the bottom left often shows your username automatically. It typically looks like username@computername:~$. The part before the @ symbol is your username. The tilde (~) represents your home folder.

Not all terminal setups display the username in the prompt — some show only a dollar sign or a different format. If your prompt does not show it, use whoami instead. But if it does, you can read your username directly without typing any command.

Understand the difference between username and display name

Ubuntu allows you to set a display name (the name shown on the login screen and in menus) that is different from your actual username (the name used in the terminal and file system). For example, your display name might be "James Rodriguez" but your username could be "jrodriguez". The whoami command and file paths always show the actual username, not the display name.

If you see a different name in Settings under Users, that is your display name. The username is what appears in the terminal and in the /home/ folder path. Both are correct — they just serve different purposes. The username is what matters when you are working in the terminal or setting file permissions.

What to do if you cannot remember your password

If you know your username but cannot log in because you forgot your password, you will need to reset it. Restart your computer and hold Shift while it boots to enter the GRUB menu. Select "Advanced options for Ubuntu" and then choose a recovery mode option. This lets you access a root prompt where you can reset your password using the passwd command followed by your username.

The exact steps depend on your Ubuntu version and how your system is configured. If you are not comfortable with the recovery process, you can also create a password reset disk before you forget your password, or ask another administrator on your machine to reset it for you. Ubuntu's help documentation covers password recovery in detail if you need step-by-step instructions.

Frequently Asked Questions

What if whoami shows "root" instead of my username?

You are logged in as the root user (the system administrator account). This happens if you used sudo -i or su to switch accounts. Type exit to return to your regular account, then run whoami again to see your actual username.

Can I change my username after I create my account?

Yes, but it is complicated because your home folder path, file permissions, and some system settings are tied to your username. You can change your display name easily in Settings, but changing the actual username requires terminal commands and can break things if done wrong. Most people create a new account with the correct username instead.

Why does my home folder show a number instead of my name?

Some systems assign usernames as numbers (like 1000 or 1001) instead of names. This is less common on desktop Ubuntu but happens on servers. The number is still your username — it works exactly the same way as a text username in all commands and file paths.

Is my username the same as my email address?

No. Your Ubuntu username is a local account name on your computer. Your email address is separate and used only for online services. They can look similar (both might contain your name), but they are not connected unless you set them up that way.