LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-06-2014, 08:07 AM   #1
newbie202
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Rep: Reputation: Disabled
Open Documents/File with Specific Application in Command Line


Hello there,

I am trying to open file/document using a specific application(e.g.):-

File - abs.odt
App - LibreOffice 4.2 Writer (Or any other app)

When I use - gnome-open abs.odt it uses the default Ebook viewer instead.

Thank you for any help.
 
Old 05-06-2014, 03:49 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Open Nautilus, select the .odt file, right click, choose "open with", select LibreOffice Writer?
Or
Code:
xdg-mime default libreoffice-writer.desktop application/vnd.oasis.opendocument.text

Last edited by unSpawn; 05-06-2014 at 03:52 PM. Reason: //More *is* more
 
Old 05-06-2014, 04:05 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Code:
oowriter abs.odt
?
 
Old 05-09-2014, 08:41 AM   #4
newbie202
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Mmmm ... not sure if I got my message across ....

Using the GUI(GNOME), when you Right-Click on the file abs.odt a pop-up menu appears. In the pop-up menu, there are several options and one of them is "Open-With -->" and when you move the mouse over it, another menu appears with applicatons for you to choose from to open the file with.

How to do the same using the Command Line?
 
Old 05-09-2014, 09:04 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by newbie202 View Post
How to do the same using the Command Line?
So explain what behaviour would you exactly expect from the command line? It's not a graphical user environment. The command line itself therefore has no way to show pop-ups so there's no menu to choose from...
 
1 members found this post helpful.
Old 05-09-2014, 10:17 AM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You're never going to get a GUI menu to choose an application from, because the command line is the command line, not a GUI. In the command line, you open an application by typing the name of its executable (which is often the same, or very similar to the name of the application). If you want to open a file with that application, you typically just type the filename after the executable.

So if you want to open abs.odt with LibreOffice Writer (executable name "oowriter"), you would type "oowriter abs.odt"
If you want to open readme.txt with gedit (executable name "gedit"), you would type "gedit readme.txt"
And so on
 
Old 05-09-2014, 01:42 PM   #7
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
Quote:
Originally Posted by suicidaleggroll View Post
You're never going to get a GUI menu to choose an application from
Not with that attitude!

Install perl-file-mimeinfo from here or from your repositories or applications center or whatever and run this command:

Code:
mimeopen -d abs.odt
You will be given a list of applications and asked to choose the one with which to open the file.
 
2 members found this post helpful.
Old 05-09-2014, 02:57 PM   #8
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,939

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
Not knowing what the gui or window manager is....


I think it still could work like swriter with some option/switch and use file name.
 
Old 05-14-2014, 03:34 AM   #9
newbie202
LQ Newbie
 
Registered: Apr 2014
Posts: 11

Original Poster
Rep: Reputation: Disabled
Cool Thank you DJ Shaji. Just the thing that I am looking for. I think that this is what I need to use Linux at runlevel 3.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to open an application from terminal (command line) beefcake1000 Linux - Newbie 10 03-21-2013 04:22 PM
SuSE 9.3 - searching for specific text in file - Command line options? EnderX Linux - Newbie 1 04-15-2010 01:45 PM
php - Read file line by line and change a specific line. anrea Programming 2 01-28-2007 01:43 PM
Howdo I open a file in Gimp 2 from the command line? shea1roh Linux - Software 4 07-12-2004 08:43 PM
re: how do I open file from command line ergo_sum Linux - Newbie 7 10-29-2003 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration