Make Aliases Persistent Across Sessions
What This Does
Save your aliases so they're available every time you open a new terminal window, not just the current session.
Why It's Useful
Teach your terminal once. Set up your aliases one time and they'll be available in every new terminal window automatically.
How to Do It
- Open your shell configuration file:
nano ~/.zshrc(or~/.bash_profilefor bash) - Add your alias on a new line:
alias ll='ls -la' - Save and exit (in nano: Control + X, then Y, then Enter)
- Run
source ~/.zshrcto load the changes, or open a new terminal window
Try This Now
Add alias ..='cd ..' to your ~/.zshrc file, save it, then open a new terminal window. Type .. to go up one directory level.
Mental Hook: Teach your terminal once.