Persistent Aliases

Device

  • Terminal

How

  1. Identify your shell by running: echo $SHELL (default on modern macOS is usually zsh).
  2. Edit the matching file: ~/.zshrc for zsh, or ~/.bash_profile / ~/.bashrc for bash.
  3. Add your alias on a new line: alias ll='ls -la'
  4. 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.

Open full demonstration ↗