View Full Version : [ubuntu] Why doesn't "open" open photos in their default app?

June 29th, 2010, 05:12 AM
I might have to tweak a setting or something else I didn't know about, but as of right now my Ubuntu 10.04 AMD64 bit VM running in now Oracle *shudder* VirtualBox. I don't suspect it has anything to do with my VM set up, I'm thinking more I have to probably set a default image application probably?

Thanks in advance,

June 29th, 2010, 05:20 AM
Open does open files with their default app, if there is one. In Nautilus, you can Edit/Preferences/Media to change the default app.

June 29th, 2010, 05:47 AM
I should have been a bit more clear. I'm talking in the command line. I changed the settings with Nautilus prefs, and nothing happened when I tried
open ./1.jpeg at the command line.

June 29th, 2010, 05:58 AM
Open is not a valid command in any shell I've used.

June 29th, 2010, 08:40 PM

The default shell in ubuntu is bash, yes?

Also it works just fine in OS X.

June 29th, 2010, 08:45 PM
You want

xdg-open file.whatever

That will use the desktop file associations set in GNOME, KDE, whatever.

"open" is a shell command for opening a program in a new VT.

June 29th, 2010, 09:35 PM
Ubuntu isn't OS X. That link is simply wrong, at least for that command. xdg-open, as posted by lykwydchykyn, does work. I've never used that, but there are lots of shell commands I don't normally use. There are just too many for me to memorize.

June 30th, 2010, 03:06 AM
Thank you. I obviously know that OS X is a modified BSD based OS and has some custom preferences for the terminal, however I figured that site would be right since it has a different page dedicated to the OS X terminal. Either way, thanks for the xfg-open command, that is what I was looking for, I think. I'll have to try it out later on tonight.

June 30th, 2010, 06:47 AM
Xdg-open isn't actually an internal bash command, it's an external executable, located in usr/bin. Open is an executable located in /bin, but it doesn't actually work in Ubuntu. The man page for open shows openvt, not open, and that's for use in a virtual terminal. I'm not sure of other distros, I've never had occasion to try it. It makes no difference whether you use bash or another shell, both are external executables, not internal shell commands.

June 30th, 2010, 11:20 PM
Good to know!