Creating aliases with OSX

September 09, 2018
  1. In Terminal, run
      cd && open -e .bash_profile
    
  2. In the opened file, add your alias. For this example, I’ll make a command zeph that opens this website in a browser:
      alias zeph="open 'https://zeph.co'"
    
  3. Save the file.

  4. Restart Terminal.

  5. 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 “work”:

alias work="cd && cd path/to/your/project && code . && npm run server && open 'http://localhost:3000'"