zsh

How to Add an Alias in Macos Terminal

Posted by Chaitanya Shahare on Thu, Nov 24, 2022

Zsh is the default MacOS Shell. So to add an alias, we need to make changes to the zsh config file that is .zshrc.

Open .zshrc

.zshrc is typically present in the home folder ~/.zshrc

Adding alias

Add the alias to the .zshrc in the following syntax

alias aliasName="command"

Source .zshrc

After saving, source .zshrc using the following command in the Terminal

$ source ~/.zshrc