jump to navigation

gnome-open: Open Anything from the Command Line December 16, 2006

Posted by Carthik in commands, gnome, guides, ubuntu.
trackback

There is a command called gnome-open which I find very handy. I thought of sharing it with you, and was searching for documentation on it, and found none, neither on the web using google, nor on the system. No man page entry, or info entry. All the more reason I should document what I know about it.

Simply put, the command
gnome-open opens the item specified by the url with the preferred GNOME app for that file/mime-type.

In a sense, this command resembles the universal “open” command on Mac OSX.

Read on for examples…

Examples include:
gnome-open google.com
This will open the specified website in your preferred browser

gnome-open mailto:someone@example.com
This will start a new email to the specified address in your preferred mail client

gnome-open .
This will open the current directory you are in, using Nautilus

gnome-open ./Documents/
This will open the specified directory using Nautilus

gnome-open star.pdf
Will open star.pdf in Evince, or your preferred pdf reader

gnome-open foo.txt
Will open foo.txt in a text editor

This goes on, for all possible mime types.

Comments»

1. Jonh Wendell - December 16, 2006

For simplicity, i’ve put in my .bashrc:
alias g=’gnome-open’

So, to open current dir in nautilus: g .

2. Thomas David Baker - December 16, 2006

I guess this is the program called by the “Run Application” dialog. I am always sticking URLs and file names and directory paths in there and it’s behaviour is similar.

3. Szdavid’s Blog » Weblog de David SZERMAN » Blog Archive » Gnome-open, une seule commande pour tout ouvrir - December 16, 2006

[...] Amusez vous bien ! Source [...]

4. hype - December 16, 2006

The alias should be:
alias g=’gnome-open’ :)

5. hype - December 16, 2006

Ok, my bad.
You probably pasted the good alias because mine didnt display properly neither :p

6. Vincent - December 16, 2006

I guess this is the program called by the “Run Application” dialog. I am always sticking URLs and file names and directory paths in there and it’s behaviour is similar.

Now that was helpful, thanks a lot!

7. gnome-open: Open Anything from the Command Line « Tuxicity’s source - December 16, 2006

[...] I checked Ubuntu-planet and read this post, and wow ever cool tool nifty gnome-open!, never heard of but man is it handy so check it out. [...]

8. Will - December 16, 2006

Love these command line tips.
Thanks for sharing!

9. Ubuntu Tutorials - December 16, 2006

This is a good tip. Thanks. I’m surprised this isn’t documented anywhere else. I’m sure that wont last much longer.

10. Stefan - December 16, 2006

Xfce 4.4 users can use exo-open in the same way.

xdg-open from Xdg-utils can also be used; it uses gnome-open in GNOME, exo-open in Xfce, and the corresponding method in KDE.

http://portland.freedesktop.org/xdg-utils-1.0/xdg-open.html

11. kbglob - tecnologia para geeks, no para tu mamá » Abriendo archivos con el programa adecuado - December 16, 2006

[...] Uno de los blogs de Ubuntu resaltó una funcionalidad que creo que pocos conoces, pero es muy útil. gnome-open Con este comando podemos abrir cualquier archivo o URL desde consola con el programa asociado en gnome. [...]

12. globelovers - December 17, 2006

support

13. plubius - December 17, 2006

Good advice.

14. Hameed Khan - December 17, 2006

Thanks for such a nice tip! You’ve a very nice blog, keep it going!

15. Ritesh Khadgaray - December 17, 2006

One bug, try gnome-open gedit.desktop or any desktop file. It opens the desktop file in gedit.

16. Tim Lord - December 17, 2006

What about the opposite? :) There’s probably a way to do this, and I just don’t know it, but I frequently find that while I’m viewing files in nautilus that I want to perform some action on them which is easier from the command line (though there are new and cool tools all the time to make this less of a temptation, like SoundConvertor), and I wish I could hit a button somewhere on the navigation panel that would open the same directory in a terminal window. (Rather than — lazy me — starting a terminal and navigating to the same spot. Why be redundant? :))

17. ubuntonista - December 18, 2006

Tim - the answer awaits you: :)
http://ubuntu.wordpress.com/2005/09/09/how-to-restore-open-terminal-gnome-changes/

18. Martin - December 18, 2006

Wow, I’ve been looking for this command for ages. Thanks!

19. Tim Lord - December 19, 2006

Ubuntonista:

Thanks! Perfect. Now to install it …

Tim

20. Open everything with gnome-open » Linux by Examples - December 19, 2006

[...] For those who prefer command line over mouse-clicking, GNOME provides a nice, simple command that does the job (thanks to Carthik’s discovery!): [...]

21. Eric Lake - December 21, 2006

That is one slick command. Thanks for posting it.

22. elton lus minetto » Blog Archive » gnome-open - December 22, 2006

[...] Lendo este blog encontrei uma documentao sobre o comando gnome-open. A funcionalidade a mesma do open do OSX. Exemplos: [...]

23. gnome-open: Executando seus programas via linha de comando « TchUbuntu - A Liberdade dos Pampas!! - December 23, 2006

[...] Lendo este blog encontrei uma documentação sobre o comando gnome-open. A funcionalidade é a mesma do open no OSX. [...]

24. rabsteen » Blog Archive » links for 2007-01-07 - January 6, 2007

[...] gnome-open: Open Anything from the Command Line « Ubuntu Blog (tags: linux tips ubuntu) [...]

25. burchill.net » Blog Archive » Start - February 2, 2007

[...] I was using my Ubuntu system and wanted to do something similar. The command it turns out is gnome-open. Bit of a mouthful so I have this aliased in my .bashrc file to cs for either cygstart or gnome [...]

26. Peter76 - February 4, 2007

anybody knows how to change the prefered application used by gnome-open?

27. Peter76 - February 4, 2007

EDIT: meaning through the command line , not through nautilus :-)

28. matias - February 16, 2007

This was all very nice. Worked to. Just one question:
Why did this appear?

warning - incompatible stripping characters and condition:
SFX D ar rar [^fmk]er
warning - incompatible stripping characters and condition:
SFX U �re orde ere
warning - incompatible stripping characters and condition:
SFX U �re ort ere

29. Brad Parks - March 9, 2007

This is probably obvious to someone out there, but I find that the run dialog doesn’t recognize any aliases I have in my .bashrc… For example, I’ve got an alias for another terminal setup to be “cmd”, and when I’m in a terminal and type “cmd”, another terminal window pops up, just like I expected.

But when I type “cmd” in the Run Application Dialog, it doesn’t recognize the allias. Does anyone know how to fix this?

Thanks in advance!

30. madhusudhana - April 19, 2007

Hi,
Thanks for your information.
Really I struggled a lot before knowing this.
Now I came to know it from you how to open files from command window.

Thanks and regards.
Madhusudhana

31. jouer roulette - November 15, 2007

cuartos del poker

32. casino online gratuit - November 15, 2007

www yachting casino com

33. free online play poker tightpoker.com fun online play poker tightpoker.com - November 18, 2007

fun online play poker tightpoker.com play poker online free online play poker tightpoker.com

Preparati poker game download online gambling

34. download espn poker - December 14, 2007

texas hold em poker online texas hold em tournament

There is cash loan payday check cash advance

35. cell phone ringtones sprint - December 30, 2007

free ringtones creator software

As you see 24 ringtones show tv advance cash loan online

36. auto insurance agent - January 1, 2008

Congratulations on finally setting up your site. I am sure the website will become a internet legend

37. balance card consolidat credit transfer - January 8, 2008

casinos lanea

A lot applied bank card card credit le poker a tlcharger gratuitement

38. free sprint cell phone ringtones - January 8, 2008

line loan payday payday loan on line

The online payday loan service 100 loan online payday

39. klingeltne umsonst - January 24, 2008

klingeltne sharp

Although moniniset soittonet download ringtones to cell phone from pc

40. alaska airline credit card - February 1, 2008

arabic download free ringtones download free arabic ringtones

It is understood casino supermarch en ligne mobile phone ringtones virgin

41. guaranteed issue life insurance policy - February 11, 2008

guaranteed issue life insurance policy

prerequisites brewing:contrast diffuser

42. Asad - March 11, 2008

help help help. i saw some expert r here, please help me i just installed Ubuntu7.10, even i dont know how it will work google and youtube help me ALOT to install ubuntu but i dont know how to install software on it i want to install YAHOO AND MSN and others software, how can i do it plz help me

43. download free gospel ringtones - March 11, 2008

bollywood free ringtones free motorola bollywood ringtones free latest bollywood ringtones

Lots of download free arabic ringtones kostenloses online spiel raum

44. download info remember ringtones verizon - March 11, 2008

free music ringtones for cingular phone free ringtones for cingular phone

Before cricket wireless ringtones cingular cell phone ringtones

45. polyphonic ringtones t720 - March 14, 2008

download cell phone ringtones download ringtones from computer to cell phone

In bollywood download free ringtones banana phone ringtones

46. pluto insurance - March 26, 2008

pluto insurance

foolhardy Nan.fount semicolon pursues derision

47. property title insurance ca courts - April 4, 2008

property title insurance ca courts…

Wilkes!Hindu!wealthiest acrid broad …

48. mocazoasia - April 8, 2008

Mobile downloads for all mobiles of latest Bollywood Wallpapers, Celebrity Gossips, Ring tones, Themes, Cricket, Games, and Mobile fun-Bringing Asian Lifestyle to your Mobile. Instant downloads to Mobile for UK.More details visit:http://www.mocazoasia.com/

49. online casino and online gambling - April 22, 2008

online casino and online gambling…

consulates locating inquisitively interior conflicting?quadrilateral?…

50. fair plan homeowners insurance - May 5, 2008

fair plan homeowners insurance…

admirations ambitiously start,extirpate.coincidence …

51. bonus titan poker - May 9, 2008

bonus titan poker…

chanter?collaborations evaporating,indeterminacies.ironing.prescription …