Set Alias in Mac
Here's how to set an alias in Mac for a command you use frequently.
Step 1: Check Your Shell
type command below in terminal to check your shell. It will be either bash(older Macs) or zsh(new Macs).
echo $SHELLYou will see output like below.

My Shell is zsh
Step 2: Open Your Shell Configuration File
If you shell is zsh, type below command in terminal to open .zshrc file.
code ~/.zshrcor (if you are using bash)
code ~/.bashrcStep 3: Add Alias
I added alias for start development server in my project.
alias d="npm run dev"After adding alias, save the file and close it.
Step 4: Reload Configuration File
source ~/.zshrcor (if you are using bash)
source ~/.bashrcStep 5: Use Alias
Now you can use alias d to start development server.
dYay! Succcessfully set alias in Mac. 🎉