Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12th November 2006, 03:22 AM
mlissner Offline
Registered User
 
Join Date: Jun 2006
Location: Berkeley
Age: 30
Posts: 58
open using default program in terminal

Is there a way to use the terminal to open things using the default program?

Like, a moment ago, I did an ls of a folder, and found the pdf document I wanted. It was then that I realized I didn't remember which program opens it, forcing me to navigate to it in a gui, and doubleclick it (I think). Google isn't bringing up and results for me on this one.

...surely there must be a simple command that opens a filetype using the default program, right?

Anybody have any ideas?

Thanks. Efficiency is everything, commandline is the way.
Reply With Quote
  #2  
Old 12th November 2006, 04:47 AM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,304
Nautilus (the desktop manager in Gnome) has several places it looks to find the program that should be used to open a file, but they're all based on MIME types. First, you use some sort of file to mimetype mapping, usually based on file extension in Linux, then you use a mapping of mimetype to application. However, there are tons of places on the filesystem that different subsystem place these mappings. If you knew where they were, or better yet, knew how to query either Nautilus or maybe gconf2 for the mapping and application association, a script would be pretty easy to write.

Unfortunately, I don't know of anything that does that. If you were willing to do a little of the up-front research to figure out a starting set of mimetype locations, I'd be happy to whip up a short script to parse them out and fire off the application, given a list of files on the command line.
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
  #3  
Old 12th November 2006, 06:21 AM
mlissner Offline
Registered User
 
Join Date: Jun 2006
Location: Berkeley
Age: 30
Posts: 58
Well that's a complicated answer isn't it then?

I'm tempted to start working on this project, as it seems mighty handy, but I think I may just be better off doing an apropos and trying programs until something works. If I had the time, I'd give it a go, but I haven't.

Ah well. Thanks for the reply.
Reply With Quote
  #4  
Old 12th November 2006, 11:47 AM
brahms Offline
Registered User
 
Join Date: Aug 2004
Posts: 434
Code:
gnome-open /path/to/file
__________________
:cool:
Reply With Quote
Reply

Tags
default, open, program, terminal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Program Used to Open File pedm Using Fedora 3 4th February 2009 03:52 AM
GNOME Terminal & Open Office will not open orion2087 Using Fedora 0 20th August 2008 07:04 PM
Command to end associations between program and terminal 1jackjack Using Fedora 3 29th June 2007 10:23 AM
Logging in to terminal run program Chipper Using Fedora 4 12th July 2006 06:45 PM


Current GMT-time: 10:22 (Saturday, 18-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat