[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
User avatar
KeesA
Level 2
Level 2
Posts: 94
Joined: Wed Jan 09, 2013 8:47 pm

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

Postby KeesA » 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
xenopeek
Level 23
Level 23
Posts: 19702
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: How to open an application with file from bash

Postby xenopeek » 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/
Image

User avatar
KeesA
Level 2
Level 2
Posts: 94
Joined: Wed Jan 09, 2013 8:47 pm

Re: How to open an application with file from bash

Postby KeesA » 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.


Return to “Newbie Questions”

Who is online

Users browsing this forum: greerd, wilbobob and 15 guests