The fastest way to see your Ubuntu username
Open a terminal and type whoami, then press Enter. The single line that appears is your username. That is the account name you use to log in.
If you are already logged in and just need to confirm the name, this is the quickest method. The terminal is usually in your Applications menu, or you can press Ctrl+Alt+T on most Ubuntu systems to open it directly.
If you do not remember your password or cannot log in, you will need a different approach — see the section below on checking usernames from the login screen.
Key Takeaways
- Type whoami in the terminal to see the username of the account currently logged in.
- The id command shows your username along with your user ID number and group memberships.
- If you cannot log in, restart the computer and hold Shift at the boot screen to access the GRUB menu, where you can see a list of user accounts.
- Your username appears in the top-right corner of the Ubuntu desktop when you are logged in.
Using the id command to see more detail
Type id in the terminal and press Enter. This shows your username along with your user ID (uid), group ID (gid), and the groups you belong to. The username appears first, right after "uid=" and before the number.
This command is useful if you need to troubleshoot permissions or confirm which groups your account belongs to. Most people use whoami for a quick answer, but id gives you the full picture of your account setup.
Checking your username from the login screen
If you cannot log in or do not remember your password, restart your computer. As it boots, hold down the Shift key until a menu appears. This is the GRUB boot menu. Select "Advanced options for Ubuntu" and then choose an entry that says "recovery mode."
From the recovery menu, select "Drop to root shell prompt." You will now have access to a command line as the root user. Type cat /etc/passwd and press Enter. This file lists all user accounts on the system. Each line shows a username at the start, followed by a colon. The usernames you see are all the accounts that exist on this computer.
This method requires you to restart the computer and navigate recovery mode, so it is slower than the terminal approach. Use it only when you cannot log in normally.
Finding your username in the system settings
Click the power icon in the top-right corner of your desktop. Select "Settings" from the menu. In the Settings window, click "About" on the left side. Your username appears near the top under "Device Name" or in the user section, depending on your Ubuntu version.
This graphical method does not require opening a terminal, so some people find it easier. However, it shows less information than the command-line methods and takes more steps.
Viewing all usernames on your computer
Open a terminal and type cat /etc/passwd, then press Enter. A long list appears. Each line represents one user account. The username is the first part of each line, before the first colon.
Most of these accounts are system accounts used by Ubuntu itself, not people. Real user accounts usually appear near the end of the list. If you set up multiple people to log in to this computer, you will see all their usernames here.
You can also type getent passwd to see the same information in a slightly different format. Both commands pull from the same system file.
What to do if you see an unexpected username
If you log in and whoami shows a username you do not recognize, check whether someone else has access to this computer. Ask anyone else who uses it whether that account belongs to them.
If you find an account you did not create and cannot explain, you may have a security issue. In that case, change your password when ready and consider running a security scan. Ubuntu comes with tools like chkrootkit that can help detect unauthorized access, though you may need to install them first.
Frequently Asked Questions
What is the difference between whoami and id?
whoami shows only your username. id shows your username plus your numeric user ID, group ID, and all groups you belong to. Use whoami for a quick answer and id when you need the full details.
Can I change my username after I create it?
Yes, but it is complicated and requires the root user or an account with sudo permissions. You must rename your home directory, update system files, and log out completely. Most people find it easier to create a new account with the desired name and transfer files over, then delete the old account.
Why do I see so many usernames when I list all accounts?
Ubuntu creates system accounts for services and background processes. These accounts like "www-data" or "mysql" are not people — they run specific programs. Your real user accounts are usually at the end of the list and have usernames you recognize.
What if whoami returns nothing or an error?
This is rare but can happen if your terminal session is corrupted. Close the terminal window and open a new one, then try again. If the problem continues, log out and log back in. If you still see an error, your user account may have a configuration problem and you may need to create a new account.
Is my username the same as my computer name?
No. Your username is the account you log in with. Your computer name (hostname) is what appears in the network and on the login screen. They are separate settings. You can see your computer name in Settings under "About," and your username with whoami.