This question already has an answer here:

Often in the terminal I want to open a specific file (since I've already browsed to the right directory).

A few programs I have come with their own links ready, like subl index.html will open Sublime Text editor. Also I am aware of the open foo which will call the file to be opened in the default program associated with it.

How can I setup a more general way of opening a file from the terminal with a specific program, either by defining a per-program helper/shortcut, or better even, in a generic way?

marked as duplicate by Nimesh Neema, Community Sep 26 '18 at 8:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Is open -a APP_NAME FILE OK? – Mateusz Szlosek Sep 26 '18 at 7:53
  • @NimeshNeema Thanks! I suggested to edit the linked question to be titled more general, since the answer there answers my problem. – kontur Sep 26 '18 at 8:21
  • Thanks to your question above there is no need to rephrase the existing question. The "duplicate" link will lead anybody to the answers either way. – nohillside Sep 26 '18 at 8:46

Browse other questions tagged .