Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

The Windows command line uses start programname and start filename.ext to process the file as if the user had double-clicked it in the GUI shells we all know and love. MacOS's command line does the same with open. That is useful for those of us who don't know the exact program and location for opening unusual file types.

On Linux, ./filename.ext is to run scripts, and start filename.ext responds with an error because it's expecting a "job". So...

What is the standard CLI command to open a non-script file under whatever the registered type-handler under Linux? If it's not standard, what does Red Hat use?

share|improve this question

marked as duplicate by Tog, Ƭᴇcʜιᴇ007, Kevin Panko, Doktoro Reichard, digitxp Jul 28 '14 at 14:13

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.

./filename.ext isn't only for scripts but for any executable file. – Andrew Lambert Jun 12 '11 at 2:29
up vote 6 down vote accepted

The standard uses xdg-open. There are others specific to KDE, GNOME, and other desktops, but xdg-open should work regardless.

share|improve this answer
+1. That was fast! I made a quick edit like a second after posting and saw your reply. And it works. I didn't think each desktop environment bundled their own as well. Thanks! – Vlueboy Jun 12 '11 at 0:49
xdg-open does not always work good (and compatible with desktop environment). For a gnome user, gnome-open is probably better. – saeedgnu Jun 12 '11 at 8:00
@ilius: xdg-open is just a shell script, and is supposed to call gnome-open if it detects that you are running GNOME. ("Patches welcome.") – grawity Jun 12 '11 at 8:52
@grawity i see, interesting, thanks – saeedgnu Jun 12 '11 at 9:36
@grawity: no reason the shell couldn't, and in fact recent versions of zsh can be configured to recognize file types and run the appropriate program. It's just not part of Unix-think. – geekosaur Jun 12 '11 at 14:50

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