Think of your morning routine: before you start your day, you automatically turn on the coffee maker and open the blinds. On a Mac, the Terminal has its own morning routine file called .zshrc.
Every time you open the Terminal app, macOS reads ~/.zshrc (located in your Home folder) to load your personal preferences and shortcuts.
What Is an Alias?
An alias is a nickname for a longer command. Instead of typing ls -la every single time to see all files and details, you can teach your Mac to understand ll.
Step 1: Open Your .zshrc File
Open Terminal and use nano, a simple built-in text editor, to open (or create) your .zshrc file:
# Open ~/.zshrc in the nano text editor
nano ~/.zshrc
Step 2: Add One or Two Helpful Aliases
Scroll to the bottom and add these beginner-friendly shortcuts. Be careful not to put spaces around the = sign:
# Show all files in a neat list when typing "ll"
alias ll="ls -la"
# Clear the Terminal screen when typing "c"
alias c="clear"
To save in nano, press Control + O, hit Return, and then press Control + X to exit.
Step 3: Apply Changes Immediately
Your new shortcuts will load automatically the next time you open Terminal. To use them right away in your current window, run:
# Reload .zshrc without closing Terminal
source ~/.zshrc
Now try typing ll and pressing Return—your custom shortcut works!
3 Things to Remember
~/.zshrcis a personal settings file that runs every time you open macOS Terminal.- An
aliaslets you create short nicknames for commands you type often (with no spaces around=). - Run
source ~/.zshrcafter editing so your changes take effect immediately.