How to start an application in terminal?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I run an application by opening a terminal then navigating to a directory and executing ./nameofapp. The application opens in terminal and I can operate it with some other commands.



If I try to run the application from file manager, it runs in the background. How can I run it in terminal?










share|improve this question























  • How do you open it outside of the command line? Is it a script or is it compiled?
    – k.stm
    Sep 16 at 13:10











  • @k.stm It is a executable file, to be concrete, in the "Properties" it says: application/x-executable.
    – Michael Narper
    Sep 16 at 13:50










  • That’s not what I meant. In the commandline, what does $ file nameofapp say? Maybe it’s not binary, but a text file. What does $ head -n 3 nameofapp say (the first three lines of the file)? More importantly, how do you open it outsite of the command line? Double-click on it in a file browser?
    – k.stm
    Sep 16 at 14:14











  • Yes I double click it, it is a compiled application that when launched only run in the background.
    – Michael Narper
    Sep 16 at 14:28














up vote
1
down vote

favorite












I run an application by opening a terminal then navigating to a directory and executing ./nameofapp. The application opens in terminal and I can operate it with some other commands.



If I try to run the application from file manager, it runs in the background. How can I run it in terminal?










share|improve this question























  • How do you open it outside of the command line? Is it a script or is it compiled?
    – k.stm
    Sep 16 at 13:10











  • @k.stm It is a executable file, to be concrete, in the "Properties" it says: application/x-executable.
    – Michael Narper
    Sep 16 at 13:50










  • That’s not what I meant. In the commandline, what does $ file nameofapp say? Maybe it’s not binary, but a text file. What does $ head -n 3 nameofapp say (the first three lines of the file)? More importantly, how do you open it outsite of the command line? Double-click on it in a file browser?
    – k.stm
    Sep 16 at 14:14











  • Yes I double click it, it is a compiled application that when launched only run in the background.
    – Michael Narper
    Sep 16 at 14:28












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I run an application by opening a terminal then navigating to a directory and executing ./nameofapp. The application opens in terminal and I can operate it with some other commands.



If I try to run the application from file manager, it runs in the background. How can I run it in terminal?










share|improve this question















I run an application by opening a terminal then navigating to a directory and executing ./nameofapp. The application opens in terminal and I can operate it with some other commands.



If I try to run the application from file manager, it runs in the background. How can I run it in terminal?







terminal desktop-environment






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 16 at 15:48









sebasth

6,60121644




6,60121644










asked Sep 16 at 12:37









Michael Narper

315




315











  • How do you open it outside of the command line? Is it a script or is it compiled?
    – k.stm
    Sep 16 at 13:10











  • @k.stm It is a executable file, to be concrete, in the "Properties" it says: application/x-executable.
    – Michael Narper
    Sep 16 at 13:50










  • That’s not what I meant. In the commandline, what does $ file nameofapp say? Maybe it’s not binary, but a text file. What does $ head -n 3 nameofapp say (the first three lines of the file)? More importantly, how do you open it outsite of the command line? Double-click on it in a file browser?
    – k.stm
    Sep 16 at 14:14











  • Yes I double click it, it is a compiled application that when launched only run in the background.
    – Michael Narper
    Sep 16 at 14:28
















  • How do you open it outside of the command line? Is it a script or is it compiled?
    – k.stm
    Sep 16 at 13:10











  • @k.stm It is a executable file, to be concrete, in the "Properties" it says: application/x-executable.
    – Michael Narper
    Sep 16 at 13:50










  • That’s not what I meant. In the commandline, what does $ file nameofapp say? Maybe it’s not binary, but a text file. What does $ head -n 3 nameofapp say (the first three lines of the file)? More importantly, how do you open it outsite of the command line? Double-click on it in a file browser?
    – k.stm
    Sep 16 at 14:14











  • Yes I double click it, it is a compiled application that when launched only run in the background.
    – Michael Narper
    Sep 16 at 14:28















How do you open it outside of the command line? Is it a script or is it compiled?
– k.stm
Sep 16 at 13:10





How do you open it outside of the command line? Is it a script or is it compiled?
– k.stm
Sep 16 at 13:10













@k.stm It is a executable file, to be concrete, in the "Properties" it says: application/x-executable.
– Michael Narper
Sep 16 at 13:50




@k.stm It is a executable file, to be concrete, in the "Properties" it says: application/x-executable.
– Michael Narper
Sep 16 at 13:50












That’s not what I meant. In the commandline, what does $ file nameofapp say? Maybe it’s not binary, but a text file. What does $ head -n 3 nameofapp say (the first three lines of the file)? More importantly, how do you open it outsite of the command line? Double-click on it in a file browser?
– k.stm
Sep 16 at 14:14





That’s not what I meant. In the commandline, what does $ file nameofapp say? Maybe it’s not binary, but a text file. What does $ head -n 3 nameofapp say (the first three lines of the file)? More importantly, how do you open it outsite of the command line? Double-click on it in a file browser?
– k.stm
Sep 16 at 14:14













Yes I double click it, it is a compiled application that when launched only run in the background.
– Michael Narper
Sep 16 at 14:28




Yes I double click it, it is a compiled application that when launched only run in the background.
– Michael Narper
Sep 16 at 14:28










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










You can write a .desktop file for your application. With terminal option the application should launch in terminal:



[Desktop Entry]
Type=Application
Name=Application Name
Exec=/path/to/nameofapp
Terminal=true


Alternatively, you can write a wrapper script that starts terminal and runs your application. For example (gnome-terminal):



#!/bin/sh
exec gnome-terminal -- ./nameofapp





share|improve this answer






















  • I tried the second option and it opens and closes inmediately, when run through terminal with "./name-of-script" it says "exec: gnome-terminal not found". Sorry for my limited knowledge, I am beginner on Linux.
    – Michael Narper
    Sep 16 at 15:08











  • You need to call a terminal application installed on system (instead of gnome-terminal). What distribution/desktop environment are you using?
    – sebasth
    Sep 16 at 15:16










  • I am using the built-in terminal on Linux 19 Tara
    – Michael Narper
    Sep 16 at 15:20











  • Your system possibly uses mate-terminal. Try modifying the script by replacing gnome-terminal with mate-terminal.
    – sebasth
    Sep 16 at 15:29










  • it opens the terminal but don't do anything, I guess it is a problem in the app. However, thanks a lot for your answer!
    – Michael Narper
    Sep 16 at 15:36










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f469380%2fhow-to-start-an-application-in-terminal%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










You can write a .desktop file for your application. With terminal option the application should launch in terminal:



[Desktop Entry]
Type=Application
Name=Application Name
Exec=/path/to/nameofapp
Terminal=true


Alternatively, you can write a wrapper script that starts terminal and runs your application. For example (gnome-terminal):



#!/bin/sh
exec gnome-terminal -- ./nameofapp





share|improve this answer






















  • I tried the second option and it opens and closes inmediately, when run through terminal with "./name-of-script" it says "exec: gnome-terminal not found". Sorry for my limited knowledge, I am beginner on Linux.
    – Michael Narper
    Sep 16 at 15:08











  • You need to call a terminal application installed on system (instead of gnome-terminal). What distribution/desktop environment are you using?
    – sebasth
    Sep 16 at 15:16










  • I am using the built-in terminal on Linux 19 Tara
    – Michael Narper
    Sep 16 at 15:20











  • Your system possibly uses mate-terminal. Try modifying the script by replacing gnome-terminal with mate-terminal.
    – sebasth
    Sep 16 at 15:29










  • it opens the terminal but don't do anything, I guess it is a problem in the app. However, thanks a lot for your answer!
    – Michael Narper
    Sep 16 at 15:36














up vote
1
down vote



accepted










You can write a .desktop file for your application. With terminal option the application should launch in terminal:



[Desktop Entry]
Type=Application
Name=Application Name
Exec=/path/to/nameofapp
Terminal=true


Alternatively, you can write a wrapper script that starts terminal and runs your application. For example (gnome-terminal):



#!/bin/sh
exec gnome-terminal -- ./nameofapp





share|improve this answer






















  • I tried the second option and it opens and closes inmediately, when run through terminal with "./name-of-script" it says "exec: gnome-terminal not found". Sorry for my limited knowledge, I am beginner on Linux.
    – Michael Narper
    Sep 16 at 15:08











  • You need to call a terminal application installed on system (instead of gnome-terminal). What distribution/desktop environment are you using?
    – sebasth
    Sep 16 at 15:16










  • I am using the built-in terminal on Linux 19 Tara
    – Michael Narper
    Sep 16 at 15:20











  • Your system possibly uses mate-terminal. Try modifying the script by replacing gnome-terminal with mate-terminal.
    – sebasth
    Sep 16 at 15:29










  • it opens the terminal but don't do anything, I guess it is a problem in the app. However, thanks a lot for your answer!
    – Michael Narper
    Sep 16 at 15:36












up vote
1
down vote



accepted







up vote
1
down vote



accepted






You can write a .desktop file for your application. With terminal option the application should launch in terminal:



[Desktop Entry]
Type=Application
Name=Application Name
Exec=/path/to/nameofapp
Terminal=true


Alternatively, you can write a wrapper script that starts terminal and runs your application. For example (gnome-terminal):



#!/bin/sh
exec gnome-terminal -- ./nameofapp





share|improve this answer














You can write a .desktop file for your application. With terminal option the application should launch in terminal:



[Desktop Entry]
Type=Application
Name=Application Name
Exec=/path/to/nameofapp
Terminal=true


Alternatively, you can write a wrapper script that starts terminal and runs your application. For example (gnome-terminal):



#!/bin/sh
exec gnome-terminal -- ./nameofapp






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 16 at 14:23

























answered Sep 16 at 14:17









sebasth

6,60121644




6,60121644











  • I tried the second option and it opens and closes inmediately, when run through terminal with "./name-of-script" it says "exec: gnome-terminal not found". Sorry for my limited knowledge, I am beginner on Linux.
    – Michael Narper
    Sep 16 at 15:08











  • You need to call a terminal application installed on system (instead of gnome-terminal). What distribution/desktop environment are you using?
    – sebasth
    Sep 16 at 15:16










  • I am using the built-in terminal on Linux 19 Tara
    – Michael Narper
    Sep 16 at 15:20











  • Your system possibly uses mate-terminal. Try modifying the script by replacing gnome-terminal with mate-terminal.
    – sebasth
    Sep 16 at 15:29










  • it opens the terminal but don't do anything, I guess it is a problem in the app. However, thanks a lot for your answer!
    – Michael Narper
    Sep 16 at 15:36
















  • I tried the second option and it opens and closes inmediately, when run through terminal with "./name-of-script" it says "exec: gnome-terminal not found". Sorry for my limited knowledge, I am beginner on Linux.
    – Michael Narper
    Sep 16 at 15:08











  • You need to call a terminal application installed on system (instead of gnome-terminal). What distribution/desktop environment are you using?
    – sebasth
    Sep 16 at 15:16










  • I am using the built-in terminal on Linux 19 Tara
    – Michael Narper
    Sep 16 at 15:20











  • Your system possibly uses mate-terminal. Try modifying the script by replacing gnome-terminal with mate-terminal.
    – sebasth
    Sep 16 at 15:29










  • it opens the terminal but don't do anything, I guess it is a problem in the app. However, thanks a lot for your answer!
    – Michael Narper
    Sep 16 at 15:36















I tried the second option and it opens and closes inmediately, when run through terminal with "./name-of-script" it says "exec: gnome-terminal not found". Sorry for my limited knowledge, I am beginner on Linux.
– Michael Narper
Sep 16 at 15:08





I tried the second option and it opens and closes inmediately, when run through terminal with "./name-of-script" it says "exec: gnome-terminal not found". Sorry for my limited knowledge, I am beginner on Linux.
– Michael Narper
Sep 16 at 15:08













You need to call a terminal application installed on system (instead of gnome-terminal). What distribution/desktop environment are you using?
– sebasth
Sep 16 at 15:16




You need to call a terminal application installed on system (instead of gnome-terminal). What distribution/desktop environment are you using?
– sebasth
Sep 16 at 15:16












I am using the built-in terminal on Linux 19 Tara
– Michael Narper
Sep 16 at 15:20





I am using the built-in terminal on Linux 19 Tara
– Michael Narper
Sep 16 at 15:20













Your system possibly uses mate-terminal. Try modifying the script by replacing gnome-terminal with mate-terminal.
– sebasth
Sep 16 at 15:29




Your system possibly uses mate-terminal. Try modifying the script by replacing gnome-terminal with mate-terminal.
– sebasth
Sep 16 at 15:29












it opens the terminal but don't do anything, I guess it is a problem in the app. However, thanks a lot for your answer!
– Michael Narper
Sep 16 at 15:36




it opens the terminal but don't do anything, I guess it is a problem in the app. However, thanks a lot for your answer!
– Michael Narper
Sep 16 at 15:36

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f469380%2fhow-to-start-an-application-in-terminal%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)