Persistent Aliases
Device
- Terminal
How
- Identify your shell by running:
echo $SHELL(default on modern macOS is usually zsh). - Edit the matching file:
~/.zshrcfor zsh, or~/.bash_profile/~/.bashrcfor bash. - Add your alias on a new line:
alias ll='ls -la' - Save the file, then run
source ~/.zshrc(or the file you edited), or open a new terminal window.
Try this
Add alias ..='cd ..' to the config file for your shell, save it, source that file, then type .. to go up one directory level.
Why it works
Teach your terminal once.