The Problem: Aliases Disappear
When you create an alias, it only lasts until you close Terminal. Next time you open it, your alias is gone.
To make aliases permanent, you need to save them in a special file.
Your Shell Configuration File
On Mac, this file is called .zshrc (the dot makes it hidden). It runs every time you open Terminal.
Open the file in TextEdit:
open -e ~/.zshrc
The -e flag tells open to use TextEdit specifically. Without it, your Mac might open the file in a different app.
Add your aliases at the bottom:
alias docs="cd ~/Documents"
Save and close TextEdit
Reload the file:
source ~/.zshrc
Key Takeaway
Put aliases in ~/.zshrc to make them permanent. Run source ~/.zshrc to reload.