The quickest way to see your Mac username
Open Terminal (find it in Applications > Utilities, or press Command + Space and type "Terminal"). Type whoami and press Enter. The name that appears is your current username.
That single command works because macOS, like Linux, tracks which user account is running each process. When you open Terminal, it runs under your user account, so whoami returns that account's name when ready.
If you want to see more detail — your full name, home directory, and user ID number all at once — type id and press Enter instead. The output shows your username, your numeric user ID, and all the groups your account belongs to.
Key Takeaways
- Type whoami in Terminal to see your username in one line.
- Type id to see your username plus your user ID number and group memberships.
- Your username appears in the Terminal prompt itself — it's the text before the @ symbol.
- If you have multiple user accounts on your Mac, each one has its own username, and Terminal shows whichever account is currently logged in.
Reading your username from the Terminal prompt
You do not need to type a command at all. Look at the line where you type — the prompt. It usually shows something like username@computername ~%. The part before the @ symbol is your username.
This works because Terminal displays your username automatically when it starts. If you have just opened Terminal and have not typed anything yet, glance at the prompt and you already have your answer.
The tilde (~) that appears after the computer name is shorthand for your home directory — the folder where your personal files live. This location is specific to your username, so seeing it confirms you are logged in as that user.
When you need to see other usernames on your Mac
If you want to list every user account on your Mac, type dscl . list /Users in Terminal. This shows all accounts, including system accounts that macOS uses behind the scenes.
The output includes accounts you may not recognize — these are service accounts that run background processes. Your personal account will be in the list, usually near the bottom. System accounts like "root", "daemon", and "nobody" can be ignored unless you are troubleshooting a specific technical problem.
If you want to see only human user accounts (not system accounts), the list is shorter but requires a more complex command. For most purposes, whoami tells you what you need to know right now.
Finding the username of another logged-in user
If multiple people are logged into your Mac at the same time, type who in Terminal to see all active user sessions. The output shows each username, which terminal or display they are using, and when they logged in.
This is different from whoami, which shows only the user running the current Terminal window. Use who when you need to know who else is on the system.
On a Mac where only one person uses the computer, who will show only one entry — your own username. On a shared Mac or a server, it shows everyone currently connected.
What to do if Terminal shows "root" or an unexpected username
If whoami returns "root" instead of your regular username, you are running Terminal with administrator privileges. This happens when you use sudo before a command or when you explicitly switch users.
To return to your normal username, type exit and press Enter. This closes the elevated session and returns you to your regular account. Your next Terminal window will show your actual username in the prompt.
If you see a username that is not yours and you did not intentionally switch users, check whether you are on the correct Mac or whether someone else's account is currently active. Restart your Mac and log in with your own account to be certain.
Why your username matters in Terminal
Your username controls which files you can read and edit, which folders Terminal can access, and what commands you are allowed to run. When you type a command, Terminal checks your username to decide whether you have permission.
Some commands require administrator access and will not work under a regular user account. Other commands work fine but only affect files in your home directory. Knowing your username helps you understand why a command succeeds or fails.
If you are following instructions that say "run this command as your username" or "check that you are logged in as the correct user", whoami is the fastest way to verify.
Frequently Asked Questions
Is my username the same as my display name?
No. Your display name is what appears in System Settings and in the login screen. Your username is a separate, usually shorter identifier that Terminal uses. You can see both by typing id -F (display name) and whoami (username) in Terminal.
Can I change my username?
Yes, but it is complicated. You change it through System Settings > General > Users & Groups, but macOS keeps the old username as your home directory name and account identifier. Most people leave it as is. If you need to change it, back up your files first.
What does the number after "uid=" mean?
That is your user ID number — a numeric identifier that macOS uses internally instead of your username. Regular user accounts usually start at 501. System accounts have lower numbers. You rarely need to know this number unless you are troubleshooting file permissions.
Why does Terminal sometimes show a different username than my login name?
This happens if you used sudo or switched users with su. Type exit to return to your original username, or open a new Terminal window to start fresh under your account.