[solved] How to open an application with file from bash

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

[solved] How to open an application with file from bash

Postby KeesA on Sat Jan 26, 2013 11:02 am

Hallo newbee forum,

Is it possible to open an application from the command line which opens a file I want?
For example: I want to open "exercise1" with the application emacs.
Last edited by KeesA on Mon Apr 08, 2013 6:57 pm, edited 1 time in total.
User avatar
KeesA
Level 2
Level 2
 
Posts: 94
Joined: Wed Jan 09, 2013 8:47 pm

Linux Mint is funded by ads and donations.
 

Re: How to open an application with file from bash

Postby xenopeek on Sat Jan 26, 2013 11:10 am

Why not? I'm assuming you launch emacs with the command "emacs" so probably the command "emacs exercise1" is worth a try. You would need to run that command from the folder in which the file exercise1 is located. Or you would instead give the relative or full path to the file exercise1 as the command's argument. Perhaps emacs needs to be told in a different way; you can usually find the command line options a program has by consulting its manpage. For emacs, the command "man emacs" should take you there. This website may be worth a read to get more comfortable on the command line: http://en.flossmanuals.net/command-line/index/
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15440
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How to open an application with file from bash

Postby KeesA on Sat Jan 26, 2013 12:30 pm

Yes it works.
I was forgotten to go to the directory where exercise1 residents.
I bookmarked the site about the command line.
My question is now solved.
thank you.
User avatar
KeesA
Level 2
Level 2
 
Posts: 94
Joined: Wed Jan 09, 2013 8:47 pm


Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], Ian Johnson, Neil Edmond, WharfRat, wilbobob and 37 guests