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
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
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/
Excellent advice and helpful comments. Maybe you could include some of them in the original posts.
gnome-open trash:
can popup a trash can
gnome-open ~/Desktop
can popup a desktop folder
I think there is more internal tag to operate the behavior of nautilus.
How to edit Gnome’s “Open With” list?
http://ubuntuforums.org/showthread.php?p=2161195
Does anyone know how to make gnome-open or the “Run application” dialog recognize aliases in my ~/.bashrc ? I’ve got some in there that I’d love to have available to either, but my aliases aren’t recognized!
i tried using the gnome-open command gnome-open http://www.website.com, it only open the firefox web browser; it did not open the specified website.
thanks thanks
can anyone tell me how to cloase a browser using command
[...] it opens right up in Document Viewer (or whatever your preferred app for PDFs is set to). See more examples here. I also added an alias “go”, since that’s a lot shorter and more [...]
how to use the terminal in ubuntu 8:10
and what you should do in to open file?
ex cd .. /
/ etc /
/ var / wwww /
help me please…..
thanks a lot for this update !
i user os x 10.5.5 and the “open” command will do fine!
when i tried the same within ubuntu i first had to install sox “sudo apt-get install sox”and could not use i though. now it works thanks to you with “gnome-open”
since this blog is CLOSE to UBUNTU…..i guess u can help me out…
see,i need to add a new option when you Right Click on desktop or any icon……
actually i need the commands to do the above….
thnx in advace!
Oops..for me gnome-open is not working..
.it looks like this…help me please..
irfan@irfan-laptop:~$ gnome-open google.com
Error showing url: Error stating file ‘/home/irfan/google.com’: No such file or directory
irfan@irfan-laptop:~$ gnome-open http://www.google.com
Error showing url: Error stating file ‘/home/irfan/www.google.com’: No such file or directory
irfan@irfan-laptop:~$
please…………..
[...] something similar on the internet, and all I found was the “gnome-open” command. The blog-post has ecstatic [...]
Please check my “go” script, which can open any URL or start an application as well.
http://linux.subogero.com/?page_id=153
Thanks alot, it play a great to me. I appriciate it .
wow, thanks so much,
I’m new to linux, and after finishing an online beginner course I couldn’t believe a command like this didn’t exist.
Thanks for the tip, I’ll go create an alias right now
ps: why the hell isn’t this documented anywhere else?
gnome-open works fine, but I am running KDE and KDE has a different default set of applications. Is there a similar command that will use the KDE default apps instead of the gnome defaults?
try kde-open
Firefox 3 users, rejoice! Today I’m pleased to announce a beta release of an enhanced version of our Firefox Add-on for del.icio.us that now has full Firefox 3 support while retaining Firefox 2 compatibility. While it is largely similar to the release version of our Firefox Add-on, there are a few nifty new features:
porno izle sex videoları seyret
thanks admin