How do I make a command run automatically (in my case: alias t="todo.sh"
) whenever I open a new terminal window? I've looked for many posts but they all have personalised commands, which then led to personalised answers. Can anybody help me with this?
MacOS – How to make a command run automatically when I open a new terminal window
macosterminal
Related Question
- Terminal – Open Safari with Multiple Tabs via Command Line
- .bash_profile Not Updating Until New Terminal Window – Fix
- Terminal – Turn Off Default New Window on Startup
- Sending text to an open terminal window with automator
- Make Terminal Tab Title Match Command – How to Guide
- Terminal Alias Command Execution on Mac Bash Mojave
- Automatically open a terminal window and run a command, robustly
Best Answer
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.
bash
, use~/.bashrc
zsh
, use~/.zshrc
You can use
echo $SHELL
to determine which shell you are using.