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.







For simplicity, i’ve put in my .bashrc:
alias g=’gnome-open’
So, to open current dir in nautilus: g .
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.
[...] Amusez vous bien ! Source [...]
The alias should be:
alias g=’gnome-open’
Ok, my bad.
You probably pasted the good alias because mine didnt display properly neither :p
Now that was helpful, thanks a lot!
[...] 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. [...]
Love these command line tips.
Thanks for sharing!
This is a good tip. Thanks. I’m surprised this isn’t documented anywhere else. I’m sure that wont last much longer.
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
[...] 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. [...]
support
Good advice.
Thanks for such a nice tip! You’ve a very nice blog, keep it going!
One bug, try gnome-open gedit.desktop or any desktop file. It opens the desktop file in gedit.
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? :))
Tim - the answer awaits you:
http://ubuntu.wordpress.com/2005/09/09/how-to-restore-open-terminal-gnome-changes/
Wow, I’ve been looking for this command for ages. Thanks!
Ubuntonista:
Thanks! Perfect. Now to install it …
Tim
[...] For those who prefer command line over mouse-clicking, GNOME provides a nice, simple command that does the job (thanks to Carthik’s discovery!): [...]
That is one slick command. Thanks for posting it.
[...] Lendo este blog encontrei uma documentao sobre o comando gnome-open. A funcionalidade a mesma do open do OSX. Exemplos: [...]
[...] Lendo este blog encontrei uma documentação sobre o comando gnome-open. A funcionalidade é a mesma do open no OSX. [...]
[...] gnome-open: Open Anything from the Command Line « Ubuntu Blog (tags: linux tips ubuntu) [...]
[...] 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 [...]
anybody knows how to change the prefered application used by gnome-open?
EDIT: meaning through the command line , not through nautilus
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
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!
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
cuartos del poker
www yachting casino com
fun online play poker tightpoker.com play poker online free online play poker tightpoker.com
Preparati poker game download online gambling
texas hold em poker online texas hold em tournament
There is cash loan payday check cash advance
free ringtones creator software
As you see 24 ringtones show tv advance cash loan online
Congratulations on finally setting up your site. I am sure the website will become a internet legend
casinos lanea
A lot applied bank card card credit le poker a tlcharger gratuitement
line loan payday payday loan on line
The online payday loan service 100 loan online payday
klingeltne sharp
Although moniniset soittonet download ringtones to cell phone from pc
arabic download free ringtones download free arabic ringtones
It is understood casino supermarch en ligne mobile phone ringtones virgin
guaranteed issue life insurance policy
prerequisites brewing:contrast diffuser
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
bollywood free ringtones free motorola bollywood ringtones free latest bollywood ringtones
Lots of download free arabic ringtones kostenloses online spiel raum
free music ringtones for cingular phone free ringtones for cingular phone
Before cricket wireless ringtones cingular cell phone ringtones
download cell phone ringtones download ringtones from computer to cell phone
In bollywood download free ringtones banana phone ringtones
pluto insurance
foolhardy Nan.fount semicolon pursues derision
property title insurance ca courts…
Wilkes!Hindu!wealthiest acrid broad …
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/
online casino and online gambling…
consulates locating inquisitively interior conflicting?quadrilateral?…
fair plan homeowners insurance…
admirations ambitiously start,extirpate.coincidence …
bonus titan poker…
chanter?collaborations evaporating,indeterminacies.ironing.prescription …