The fastest way to change your Mac username from Terminal

You can change your Mac username using Terminal without restarting into Recovery Mode or creating a new account. The process involves two separate changes: your short username (the one Terminal uses) and your display name (what appears in System Settings and on your login screen). Most people need to change both.

The short username lives in your system's user directory. To change it, you use the Terminal command mv to rename your home folder, then update the system's user database with dscl. The display name is simpler — you can change it directly in System Settings without Terminal at all. If you only care about what appears on your login screen and in menus, skip Terminal entirely and go to System Settings > General > About, then click "Edit" next to your name.

Key Takeaways

  • Your short username (used in Terminal) and display name (shown on login screen) are separate things, and you may need to change one or both.
  • Changing your short username requires Terminal commands and a temporary admin account, because you cannot rename your own active home folder.
  • Changing your display name alone takes 30 seconds in System Settings and requires no Terminal at all.
  • After changing your short username, you must log out completely, log back in with the new name, and verify that your home folder path has updated.
  • If you use iCloud, Time Machine, or other services tied to your username, test them after the change to make sure they still work.

When you need Terminal versus System Settings

Open System Settings and navigate to General > About. The name you see there is your display name — it appears on your login screen, in menus, and in Mail. You can edit it by clicking the "Edit" button next to your name. This change takes effect when ready and requires no Terminal.

Your short username is different. It is the name that appears in Terminal when you type whoami, and it is the folder name inside /Users/ where your files live. If you type ls /Users/ in Terminal, you will see a folder with your short username. To change this, you must use Terminal commands. Most people do not need to change their short username — changing the display name alone is enough for everyday use.

Change your short username only if you have a specific reason: you want a shorter name in Terminal, you inherited an account with a name you do not want, or you are setting up a new account structure. If you are unsure whether you need to change it, you probably do not.

The Terminal commands to change your short username

Before you start, create a second admin account or have another admin account ready. You cannot rename your own home folder while you are logged in as that user — the system will not allow it. You will log into the temporary account, rename your original account's folder and username, then log back into your original account with the new name.

Log out of your main account. Log in as the temporary admin account. Open Terminal and type the following command, replacing oldusername with your current short username and newusername with what you want it to be:

sudo dscl . -change /Users/oldusername RecordName oldusername newusername

Type your admin password when prompted. This updates the system's user database. Next, rename your home folder by typing:

sudo mv /Users/oldusername /Users/newusername

Again, type your admin password. The folder is now renamed. Log out of the temporary account, log back into your original account, and use your new short username at the login screen. Open Terminal and type whoami to confirm the change took effect.

What to check after you change your username

After you log back in with your new username, open Terminal and type pwd. The output should show your home folder path with your new username — for example, /Users/newusername. If it still shows the old path, log out completely and log back in again.

Check that your files are still where you expect them. Open Finder and press Command+Shift+H to go to your home folder. All your Desktop, Documents, Downloads, and other folders should be there. If you see an empty folder or a folder with your old username, something went wrong — do not delete anything, and restart your Mac to see if the system corrects itself on reboot.

If you use iCloud, open System Settings > [Your Name] > iCloud and make sure your account is still signed in. iCloud is usually tied to your Apple ID, not your username, so it should work fine. If you use Time Machine, open System Settings > General > Time Machine and check that backups are still running. Some backup software may need you to re-enter your credentials after a username change.

If you use any services that store credentials tied to your old username — like SSH keys, Git configuration, or saved passwords in Keychain — those may still reference the old path. For most people this is not a problem, but if you notice authentication errors after the change, you may need to update those settings manually.

How to undo a username change

If something goes wrong, you can reverse the change using the same method. Log into your temporary admin account, open Terminal, and run the same commands in reverse — change the new username back to the old one, and rename the folder back. The system will restore your access on the next login.

If you cannot log in at all after the change, restart your Mac and hold Command+S to enter Single-User Mode (on Intel Macs) or Command+Option+R for Recovery Mode (on Apple Silicon Macs). From there you can use command-line tools to rename the folder and user record back to the original. If you are not comfortable with that, restart into Recovery Mode, use Disk Utility to verify your drive, and then contact Apple Support with the details of what you changed.

Why your display name and short username are separate

macOS inherited this design from Unix, where the short username is a system identifier used for file permissions, processes, and network services. Your display name is purely cosmetic — it is what humans see. Separating them lets you have a friendly name on your login screen while keeping a straightforward, standardized identifier under the hood.

This is why you can change your display name when ready in System Settings without any Terminal work — the system does not need to touch any files or permissions. Your short username, by contrast, is baked into your home folder path and your user record in the system database, so changing it requires administrative access and careful steps to avoid breaking file permissions.

Frequently Asked Questions

Can I change my username without creating a temporary admin account?

No. macOS will not let you rename your own home folder while you are logged in as that user, because the system needs to update file permissions and your user record at the same time. You must log in as a different admin user to make the change. If you do not have a second admin account, create one in System Settings > General > Users & Groups before you start.

Will changing my username affect my files or permissions?

No. The mv command preserves all file permissions and ownership. Your files will be exactly where they were, just in a folder with a new name. The dscl command updates the system's record of who owns those files, so permissions stay intact.

What if I only want to change what appears on my login screen?

That is your display name, and you can change it in System Settings > General > About by clicking "Edit" next to your name. No Terminal required, and it takes effect when ready. Your short username in Terminal will not change.

Do I need to change my password after changing my username?

No. Your password is tied to your user account, not your username. It will work exactly the same after the change. You do not need to reset it or re-enter it unless you have trouble logging in.

What happens to my email if I change my username?

Your email address is tied to your iCloud account or email provider, not to your Mac username. Changing your Mac username will not affect your email. Mail will continue to work as long as you stay signed into your iCloud account in System Settings.