How to open a specific application like macOS `open -a`?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












On macOS in the default Terminal running bash, I can type open -a Firefox http://www.wikipedia.org to open a URL with Firefox, or another browser. It also works to launch a program, e.g. open -a maps, and to open a file in the default program, e.g. open file.pdf.



How can I do the same on Ubuntu in the default GNOME Terminal also running bash? I know that I can open a file or URL with xdg-open /path/to/file, and I can open the default browser with sensible-browser. Does Ubuntu have a general command to open files, applications, or files in specific applications?



I am running bash on both machines, 3.2.57(1)-release on macOS and 4.4.19(1)-release on Ubuntu.










share|improve this question







New contributor




mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    1
    down vote

    favorite












    On macOS in the default Terminal running bash, I can type open -a Firefox http://www.wikipedia.org to open a URL with Firefox, or another browser. It also works to launch a program, e.g. open -a maps, and to open a file in the default program, e.g. open file.pdf.



    How can I do the same on Ubuntu in the default GNOME Terminal also running bash? I know that I can open a file or URL with xdg-open /path/to/file, and I can open the default browser with sensible-browser. Does Ubuntu have a general command to open files, applications, or files in specific applications?



    I am running bash on both machines, 3.2.57(1)-release on macOS and 4.4.19(1)-release on Ubuntu.










    share|improve this question







    New contributor




    mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      On macOS in the default Terminal running bash, I can type open -a Firefox http://www.wikipedia.org to open a URL with Firefox, or another browser. It also works to launch a program, e.g. open -a maps, and to open a file in the default program, e.g. open file.pdf.



      How can I do the same on Ubuntu in the default GNOME Terminal also running bash? I know that I can open a file or URL with xdg-open /path/to/file, and I can open the default browser with sensible-browser. Does Ubuntu have a general command to open files, applications, or files in specific applications?



      I am running bash on both machines, 3.2.57(1)-release on macOS and 4.4.19(1)-release on Ubuntu.










      share|improve this question







      New contributor




      mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      On macOS in the default Terminal running bash, I can type open -a Firefox http://www.wikipedia.org to open a URL with Firefox, or another browser. It also works to launch a program, e.g. open -a maps, and to open a file in the default program, e.g. open file.pdf.



      How can I do the same on Ubuntu in the default GNOME Terminal also running bash? I know that I can open a file or URL with xdg-open /path/to/file, and I can open the default browser with sensible-browser. Does Ubuntu have a general command to open files, applications, or files in specific applications?



      I am running bash on both machines, 3.2.57(1)-release on macOS and 4.4.19(1)-release on Ubuntu.







      command-line bash






      share|improve this question







      New contributor




      mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 56 mins ago









      mmorin

      1145




      1145




      New contributor




      mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      mmorin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You can specifically use your desired program's name (if it's able to be used as a command line tool).



          For example, urls:



          firefox duckduckgo.com
          chromium-browser askubuntu.com


          PDF:



          evince foo.pdf
          okular bar.pdf


          Images:



          gpicview foo.png
          feh bar.jpeg


          Texts:



          gedit foo.txt
          mousepad /etc/config
          leafpad bar.xml


          Video/Music:



          mpv foo.mp3
          vlc bar.mp4





          share|improve this answer






















          • eog picture.jpg for images too if you have gnome-desktop installed :)
            – Videonauth
            48 mins ago










          • @Videonauth Yeah, or any other kind of tools ;)
            – Ravexina
            47 mins ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          mmorin is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1080846%2fhow-to-open-a-specific-application-like-macos-open-a%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          You can specifically use your desired program's name (if it's able to be used as a command line tool).



          For example, urls:



          firefox duckduckgo.com
          chromium-browser askubuntu.com


          PDF:



          evince foo.pdf
          okular bar.pdf


          Images:



          gpicview foo.png
          feh bar.jpeg


          Texts:



          gedit foo.txt
          mousepad /etc/config
          leafpad bar.xml


          Video/Music:



          mpv foo.mp3
          vlc bar.mp4





          share|improve this answer






















          • eog picture.jpg for images too if you have gnome-desktop installed :)
            – Videonauth
            48 mins ago










          • @Videonauth Yeah, or any other kind of tools ;)
            – Ravexina
            47 mins ago














          up vote
          2
          down vote



          accepted










          You can specifically use your desired program's name (if it's able to be used as a command line tool).



          For example, urls:



          firefox duckduckgo.com
          chromium-browser askubuntu.com


          PDF:



          evince foo.pdf
          okular bar.pdf


          Images:



          gpicview foo.png
          feh bar.jpeg


          Texts:



          gedit foo.txt
          mousepad /etc/config
          leafpad bar.xml


          Video/Music:



          mpv foo.mp3
          vlc bar.mp4





          share|improve this answer






















          • eog picture.jpg for images too if you have gnome-desktop installed :)
            – Videonauth
            48 mins ago










          • @Videonauth Yeah, or any other kind of tools ;)
            – Ravexina
            47 mins ago












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          You can specifically use your desired program's name (if it's able to be used as a command line tool).



          For example, urls:



          firefox duckduckgo.com
          chromium-browser askubuntu.com


          PDF:



          evince foo.pdf
          okular bar.pdf


          Images:



          gpicview foo.png
          feh bar.jpeg


          Texts:



          gedit foo.txt
          mousepad /etc/config
          leafpad bar.xml


          Video/Music:



          mpv foo.mp3
          vlc bar.mp4





          share|improve this answer














          You can specifically use your desired program's name (if it's able to be used as a command line tool).



          For example, urls:



          firefox duckduckgo.com
          chromium-browser askubuntu.com


          PDF:



          evince foo.pdf
          okular bar.pdf


          Images:



          gpicview foo.png
          feh bar.jpeg


          Texts:



          gedit foo.txt
          mousepad /etc/config
          leafpad bar.xml


          Video/Music:



          mpv foo.mp3
          vlc bar.mp4






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 41 mins ago

























          answered 51 mins ago









          Ravexina

          28.8k147098




          28.8k147098











          • eog picture.jpg for images too if you have gnome-desktop installed :)
            – Videonauth
            48 mins ago










          • @Videonauth Yeah, or any other kind of tools ;)
            – Ravexina
            47 mins ago
















          • eog picture.jpg for images too if you have gnome-desktop installed :)
            – Videonauth
            48 mins ago










          • @Videonauth Yeah, or any other kind of tools ;)
            – Ravexina
            47 mins ago















          eog picture.jpg for images too if you have gnome-desktop installed :)
          – Videonauth
          48 mins ago




          eog picture.jpg for images too if you have gnome-desktop installed :)
          – Videonauth
          48 mins ago












          @Videonauth Yeah, or any other kind of tools ;)
          – Ravexina
          47 mins ago




          @Videonauth Yeah, or any other kind of tools ;)
          – Ravexina
          47 mins ago










          mmorin is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          mmorin is a new contributor. Be nice, and check out our Code of Conduct.












          mmorin is a new contributor. Be nice, and check out our Code of Conduct.











          mmorin is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1080846%2fhow-to-open-a-specific-application-like-macos-open-a%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          Installing NextGIS Connect into QGIS 3?

          One-line joke