MacOS – How to create ‘gch.app’ such that “open -a gch page.html” works like “open -a Google\ Chrome page.html”

applicationscommand linemacossymlinkterminal

I type open -a all the time from the terminal, and more often than not the application I want is Google Chrome.app, so I end up entering things along the lines of:

open -a Google\ Chrome some_file.html

I'd like to create a symlink/shortcut to /Applications/Google Chrome.app named gch.app or what have you, so I can open -a gch foo.html which is slightly quicker.

Admittedly it'd take months+ to recoup the amount of time it's taken me to ask this question… I know I could create zsh aliases and/or bash functions for this kind of thing but I'm relatively new to OSX and want to learn.

My first intuition was to try things along the lines of:

ln -s /Applications/Google\ Chrome.app /Applications/gch.app

but no dice were had.

Best Answer

The application name is defined by the application itself, there is no easy way to use a different one for open. So in this case using an alias is probably the best option

alias gch='open -a Google\ Chrome'

Alternatively you could define Chrome as the default application for html files and just use open some_file.html.