All Modules / Module 6 / Lesson 3 of 4

Aliases as permanent shortcuts

5 minute read

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.

1

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.

2

Add your aliases at the bottom:

alias docs="cd ~/Documents"
3

Save and close TextEdit

4

Reload the file:

source ~/.zshrc

Key Takeaway

Put aliases in ~/.zshrc to make them permanent. Run source ~/.zshrc to reload.