- In Terminal, run
cd && open -e .bash_profile
- In the opened file, add your alias. For this example, I’ll make a command
zephthat opens this website in a browser:
alias zeph="open 'https://zeph.co'"
Save the file.
- Now you can run your command.
Bonus tip: You can use
&& to chain commands. The following command will navigate to your chosen project, open VS Code, start an
npm server, and open your browser when you simply type “
alias work="cd && cd path/to/your/project && code . && npm run server && open 'http://localhost:3000'"