Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Windows, I can launch an Explorer window from a command line via "start (dirname)". And this will also launch applications associated with a particular file extension, so I can do "start myfile.txt" and it will open the file in the default text editor (e.g. Notepad). Essentially, Windows exposes a way through the command line to perform the same action as a double-click in Explorer.

Does something similar exist for Gnome? I scanned down the list returned by "apropos gnome", "apropos start", and "apropos open", and nothing looked promising. (I'm using Debian Lenny, if that matters.) I know I can open a file browser via "nautilus (dirname)", etc, but I would prefer to use something that uses my file associations.

My eventual goal is to make an alias from "start" to this command since I'm more familiar with the Windows interface.

share|improve this question
add comment

4 Answers 4

up vote 4 down vote accepted

Use the gnome-open command and it will use the application you have associated with that file type (MIME). For example:

gnome-open foo.pdf
share|improve this answer
    
Gah! It's so obvious when you know the answer. Thanks! –  Tadmas Oct 16 '09 at 12:07
add comment
 nautilus .

I use it all the time! Works for folders, only.

share|improve this answer
add comment

A cross-distribution, cross-desktop manager command to achieve this is:

xdg-open foo.bar
share|improve this answer
add comment

There is also see and edit:

  # opens PDF viewer
  see file.pdf

  # Opens text editor
  edit file.txt

This is part of the mime-support package.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.