Skip to content

Instantly share code, notes, and snippets.

@data-enhanced
Last active December 26, 2015 04:48
Show Gist options
  • Select an option

  • Save data-enhanced/7095641 to your computer and use it in GitHub Desktop.

Select an option

Save data-enhanced/7095641 to your computer and use it in GitHub Desktop.
Use OS X Terminal to open a chosen file (or URL) in Firefox, Safari, or Google Chrome

We'll create Terminal aliases to efficiently open files in our browser of choice.

From Terminal ...

Edit the bash profile, by typing:

vim .bash_profile

Then type i to insert.

Insert these lines:

alias ff='open -a Firefox'
alias chr='open -a Google\ Chrome'
alias saf='open -a Safari'

Hit the Escape key to stop editing.

Type :wq to save and quit the editor.

Type exit to exit the terminal session.

Quit and restart Terminal.

Type ff filename.html to open the desired file in Firefox.

And so on.

For more great Terminal power tips, see Become a Command Line Ninja With These Time-Saving Shortcuts - Lifehacker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment