How do you replace commands in the terminal?

You should be able to do the same as your were doing in Linux in macOS.

As an example, if using bash, adding

alias vscode="open -a 'Visual Studio Code'"

to your .bash_profile file will let you just type vscode in Terminal to open Visual Studio Code.


Note: If you are running macOS Catalina, or later, and have not installed a more recent version of bash and are using the default zsh shell, then put aliases in your ~/.zprofile, or the appropriate file for the shell you are running.

Also, you might want to read Visual Studio Code on macOS to add the code executable to your PATH or path, depending on your shell.