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.

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
    
./filename.ext isn't only for scripts but for any executable file. –  Andrew Lambert Jun 12 '11 at 2:29
add comment

1 Answer 1

up vote 5 down vote accepted

The freedesktop.org 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. –  ilius 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 –  ilius Jun 12 '11 at 9:36
1  
@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
show 3 more comments

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.