Open file with default application from terminal (Ubuntu/Gnome)

Posted on July 6, 2007

If you want to open up a file or folder using the default application from your terminal in ubuntu (or any linux distrib using gnome), just use gnome-open. Like this:

gnome-open ~/docs/something.pdf

Gnome will use it’s file association tables to open it in the correct application, and you won’t have to worry about remembering what your pdf viewer is called.

» Filed Under gnome, linux. howto, ubuntu

Comments

4 Responses to “Open file with default application from terminal (Ubuntu/Gnome)”

  1. Sugu on December 1st, 2008 14:58

    Thanks a lot!!!

  2. Nargis on January 12th, 2009 23:49

    hi,

    gnome-open smb://servername/shared/filename -U domain\username%password
    this works only after opening file once from run command.

    and it is opeing file for user but for root it is throwing some unknown error.

    i am not getting why it is not able to open with root.

  3. Kenneth Schepps on February 3rd, 2009 14:52

    What if another program is opening a file. My issue is using a Linux program Xilinx to open a Windows program ModelSim. I need exe files to default to Wine so I don’t get the error: run-detectors: unable to find an interpreter for… It was working in a different version of Wine, but I had to recompile it work with another needed program. In the process I lost this default.

  4. David Dean on February 3rd, 2009 15:51

    Kenneth, you need to change the default application for exes. When you (presumably) uninstalled your previous Wine installation to add the self-compiled version, it removed the association. I think you can do by right clicking on a .exe file in Nautilus and selecting Properties.

Leave a Reply




  • Pages

  • Recent Posts

  • Categories

  • Interesting from Elsewhere

  • Meta