How to start an application in terminal?

Clash 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?
terminal desktop-environment
add a comment |Â
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?
terminal desktop-environment
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 nameofappsay? Maybe itâÂÂs not binary, but a text file. What does$ head -n 3 nameofappsay (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
add a comment |Â
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?
terminal desktop-environment
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
terminal desktop-environment
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 nameofappsay? Maybe itâÂÂs not binary, but a text file. What does$ head -n 3 nameofappsay (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
add a comment |Â
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 nameofappsay? Maybe itâÂÂs not binary, but a text file. What does$ head -n 3 nameofappsay (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
add a comment |Â
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
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 ofgnome-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 usesmate-terminal. Try modifying the script by replacinggnome-terminalwithmate-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
add a comment |Â
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
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 ofgnome-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 usesmate-terminal. Try modifying the script by replacinggnome-terminalwithmate-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
add a comment |Â
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
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 ofgnome-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 usesmate-terminal. Try modifying the script by replacinggnome-terminalwithmate-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
add a comment |Â
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
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
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 ofgnome-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 usesmate-terminal. Try modifying the script by replacinggnome-terminalwithmate-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
add a comment |Â
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 ofgnome-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 usesmate-terminal. Try modifying the script by replacinggnome-terminalwithmate-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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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 nameofappsay? Maybe itâÂÂs not binary, but a text file. What does$ head -n 3 nameofappsay (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