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

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
KeesA

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

Post by KeesA »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: How to open an application with file from bash

Post by xenopeek »

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
KeesA

Re: How to open an application with file from bash

Post by KeesA »

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.
Locked

Return to “Beginner Questions”