How do I make a command run automatically when I open a new terminal window?
Each shell has initialisation files which get run at each start (aka new Terminal tab/window). Put the command into the appropriate one and it will be available in new tabs.
- for
bash
, use~/.bashrc
- for
zsh
, use~/.zshrc
You can use echo $SHELL
to determine which shell you are using.