how can I open a extra console and run a program in it with one command?












1















So I know if I type gnome-terminal or xterm, a new window will be popped out. Then I checked the man page for these two, nothing relevant found.



Then I noticed under Mac you can do it with the program open. But it seems under Linux it's not that trivial.



Does anyone have experience?










share|improve this question























  • See man gnome-terminal again. It's there.

    – user535733
    Nov 9 '17 at 16:49
















1















So I know if I type gnome-terminal or xterm, a new window will be popped out. Then I checked the man page for these two, nothing relevant found.



Then I noticed under Mac you can do it with the program open. But it seems under Linux it's not that trivial.



Does anyone have experience?










share|improve this question























  • See man gnome-terminal again. It's there.

    – user535733
    Nov 9 '17 at 16:49














1












1








1


0






So I know if I type gnome-terminal or xterm, a new window will be popped out. Then I checked the man page for these two, nothing relevant found.



Then I noticed under Mac you can do it with the program open. But it seems under Linux it's not that trivial.



Does anyone have experience?










share|improve this question














So I know if I type gnome-terminal or xterm, a new window will be popped out. Then I checked the man page for these two, nothing relevant found.



Then I noticed under Mac you can do it with the program open. But it seems under Linux it's not that trivial.



Does anyone have experience?







gnome-terminal xterm






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 '17 at 16:17









J.R.J.R.

184




184













  • See man gnome-terminal again. It's there.

    – user535733
    Nov 9 '17 at 16:49



















  • See man gnome-terminal again. It's there.

    – user535733
    Nov 9 '17 at 16:49

















See man gnome-terminal again. It's there.

– user535733
Nov 9 '17 at 16:49





See man gnome-terminal again. It's there.

– user535733
Nov 9 '17 at 16:49










5 Answers
5






active

oldest

votes


















0














I would prefer to use the option -x that provides more reliable work than -e:



gnome-terminal -x bash -c "<my command or script>; exec bash"



  • The option -x means --execute - the remainder of the command line inside the terminal.


  • And our command is bash -c "<commands>". That means we execute a new bash shell, which should run some -c "<commands>".


  • We have two separated (by semicolon ; == new line) <commands>.


  • The first command <my command or script> will execute that we want.


  • The second command exec bash has a meaning - remain open the current gnome-terminal window. There are another possible approaches to do that. In the current case the command exec will replace the current process image with a new process image - in other words it will 'kill' the current process and will execute a new (bash) under the current PID.





Update: The -x/-e syntax is now deprecated - Ubuntu 18.04. The new recommended way is :



gnome-terminal -- bash -c "<my command or script>; exec bash"



  • If you want to reach the users home directory within the above command use the environment variable $HOME: bash -c "cd $HOME/; ..."




More examples of usage of this format:




  • Open a new terminal and source scripts

  • Launch gnome-terminal from SSH session to Desktop session

  • Start Specific Terminal on Startup

  • Crontab and C program that should be executed into a terminal window

  • Xdotool does not minimize terminal window when using in Startup Application when pc boots?






share|improve this answer


























  • I got it. If I simply type gnome-terminal -x ./main it won't work. Cause "bash" is the parameter I have to pass to run ./main?

    – J.R.
    Nov 9 '17 at 17:41











  • @J.R. Here is a detailed explanation: askubuntu.com/a/967720/566421

    – pa4080
    Nov 9 '17 at 17:53











  • @J.R. I think gnome-terminal -x ./main shall work, but the terminal is closed too fast. Also using of /full/path/ is better than ./, you also could provide and working directory for the new gnome-terminal instance --working-directory='/home/<user>/.....

    – pa4080
    Nov 9 '17 at 18:19











  • nice. Thnx for the help. Still one small question. Can I set it to something like the console in a programming IDE? Like the console shows "type anything to continue", then if I type enter the console will be closed rather than typing "exit".

    – J.R.
    Nov 10 '17 at 7:28








  • 1





    Hi man I solved it myself by setting export PROMPT_COMMAND="exit"

    – J.R.
    Nov 10 '17 at 8:04



















0














gnome-terminal -e cmd will open a terminal window and run cmd within it.






share|improve this answer
























  • Hi. This is also the weird part with me. After I type "gnome-terminal -e ./main", an extra console is opened but I got a error and the program is not executed correctly. If I run it with built in program like "gnome-terminal -e ls", it seems somethings happened, but no extra console will be opened.

    – J.R.
    Nov 9 '17 at 17:27











  • @J.R. the command is executed but the terminal closes after it executes the command

    – lapisdecor
    Nov 9 '17 at 17:31











  • @lapisdecor ah, ok, so I should add something like "cmd -k" for genome as well?But why gnome-terminal -e ./main not working?

    – J.R.
    Nov 9 '17 at 17:36











  • try gnome-terminal -e "bash -c ls;bash"

    – lapisdecor
    Nov 9 '17 at 17:47



















0














You can simply do CTRLALTT and you will open a new terminal.



Try gnome-terminal -e "bash -c command;bash"






share|improve this answer

































    0














    Another approach that will keep the window open is to use xterm:



    xterm -hold -e cmd


    The hold option keeps the window open.






    share|improve this answer































      0














      and if i want to execute with a superuser, what i will have to add?



      Because i'm trying something like:
      gnome-terminal -x bash -c "sudo /usr/local/sbin/smequeue; exec bash"






      share|improve this answer








      New contributor




      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





















      • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

        – CentaurusA
        2 hours ago











      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f974756%2fhow-can-i-open-a-extra-console-and-run-a-program-in-it-with-one-command%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      I would prefer to use the option -x that provides more reliable work than -e:



      gnome-terminal -x bash -c "<my command or script>; exec bash"



      • The option -x means --execute - the remainder of the command line inside the terminal.


      • And our command is bash -c "<commands>". That means we execute a new bash shell, which should run some -c "<commands>".


      • We have two separated (by semicolon ; == new line) <commands>.


      • The first command <my command or script> will execute that we want.


      • The second command exec bash has a meaning - remain open the current gnome-terminal window. There are another possible approaches to do that. In the current case the command exec will replace the current process image with a new process image - in other words it will 'kill' the current process and will execute a new (bash) under the current PID.





      Update: The -x/-e syntax is now deprecated - Ubuntu 18.04. The new recommended way is :



      gnome-terminal -- bash -c "<my command or script>; exec bash"



      • If you want to reach the users home directory within the above command use the environment variable $HOME: bash -c "cd $HOME/; ..."




      More examples of usage of this format:




      • Open a new terminal and source scripts

      • Launch gnome-terminal from SSH session to Desktop session

      • Start Specific Terminal on Startup

      • Crontab and C program that should be executed into a terminal window

      • Xdotool does not minimize terminal window when using in Startup Application when pc boots?






      share|improve this answer


























      • I got it. If I simply type gnome-terminal -x ./main it won't work. Cause "bash" is the parameter I have to pass to run ./main?

        – J.R.
        Nov 9 '17 at 17:41











      • @J.R. Here is a detailed explanation: askubuntu.com/a/967720/566421

        – pa4080
        Nov 9 '17 at 17:53











      • @J.R. I think gnome-terminal -x ./main shall work, but the terminal is closed too fast. Also using of /full/path/ is better than ./, you also could provide and working directory for the new gnome-terminal instance --working-directory='/home/<user>/.....

        – pa4080
        Nov 9 '17 at 18:19











      • nice. Thnx for the help. Still one small question. Can I set it to something like the console in a programming IDE? Like the console shows "type anything to continue", then if I type enter the console will be closed rather than typing "exit".

        – J.R.
        Nov 10 '17 at 7:28








      • 1





        Hi man I solved it myself by setting export PROMPT_COMMAND="exit"

        – J.R.
        Nov 10 '17 at 8:04
















      0














      I would prefer to use the option -x that provides more reliable work than -e:



      gnome-terminal -x bash -c "<my command or script>; exec bash"



      • The option -x means --execute - the remainder of the command line inside the terminal.


      • And our command is bash -c "<commands>". That means we execute a new bash shell, which should run some -c "<commands>".


      • We have two separated (by semicolon ; == new line) <commands>.


      • The first command <my command or script> will execute that we want.


      • The second command exec bash has a meaning - remain open the current gnome-terminal window. There are another possible approaches to do that. In the current case the command exec will replace the current process image with a new process image - in other words it will 'kill' the current process and will execute a new (bash) under the current PID.





      Update: The -x/-e syntax is now deprecated - Ubuntu 18.04. The new recommended way is :



      gnome-terminal -- bash -c "<my command or script>; exec bash"



      • If you want to reach the users home directory within the above command use the environment variable $HOME: bash -c "cd $HOME/; ..."




      More examples of usage of this format:




      • Open a new terminal and source scripts

      • Launch gnome-terminal from SSH session to Desktop session

      • Start Specific Terminal on Startup

      • Crontab and C program that should be executed into a terminal window

      • Xdotool does not minimize terminal window when using in Startup Application when pc boots?






      share|improve this answer


























      • I got it. If I simply type gnome-terminal -x ./main it won't work. Cause "bash" is the parameter I have to pass to run ./main?

        – J.R.
        Nov 9 '17 at 17:41











      • @J.R. Here is a detailed explanation: askubuntu.com/a/967720/566421

        – pa4080
        Nov 9 '17 at 17:53











      • @J.R. I think gnome-terminal -x ./main shall work, but the terminal is closed too fast. Also using of /full/path/ is better than ./, you also could provide and working directory for the new gnome-terminal instance --working-directory='/home/<user>/.....

        – pa4080
        Nov 9 '17 at 18:19











      • nice. Thnx for the help. Still one small question. Can I set it to something like the console in a programming IDE? Like the console shows "type anything to continue", then if I type enter the console will be closed rather than typing "exit".

        – J.R.
        Nov 10 '17 at 7:28








      • 1





        Hi man I solved it myself by setting export PROMPT_COMMAND="exit"

        – J.R.
        Nov 10 '17 at 8:04














      0












      0








      0







      I would prefer to use the option -x that provides more reliable work than -e:



      gnome-terminal -x bash -c "<my command or script>; exec bash"



      • The option -x means --execute - the remainder of the command line inside the terminal.


      • And our command is bash -c "<commands>". That means we execute a new bash shell, which should run some -c "<commands>".


      • We have two separated (by semicolon ; == new line) <commands>.


      • The first command <my command or script> will execute that we want.


      • The second command exec bash has a meaning - remain open the current gnome-terminal window. There are another possible approaches to do that. In the current case the command exec will replace the current process image with a new process image - in other words it will 'kill' the current process and will execute a new (bash) under the current PID.





      Update: The -x/-e syntax is now deprecated - Ubuntu 18.04. The new recommended way is :



      gnome-terminal -- bash -c "<my command or script>; exec bash"



      • If you want to reach the users home directory within the above command use the environment variable $HOME: bash -c "cd $HOME/; ..."




      More examples of usage of this format:




      • Open a new terminal and source scripts

      • Launch gnome-terminal from SSH session to Desktop session

      • Start Specific Terminal on Startup

      • Crontab and C program that should be executed into a terminal window

      • Xdotool does not minimize terminal window when using in Startup Application when pc boots?






      share|improve this answer















      I would prefer to use the option -x that provides more reliable work than -e:



      gnome-terminal -x bash -c "<my command or script>; exec bash"



      • The option -x means --execute - the remainder of the command line inside the terminal.


      • And our command is bash -c "<commands>". That means we execute a new bash shell, which should run some -c "<commands>".


      • We have two separated (by semicolon ; == new line) <commands>.


      • The first command <my command or script> will execute that we want.


      • The second command exec bash has a meaning - remain open the current gnome-terminal window. There are another possible approaches to do that. In the current case the command exec will replace the current process image with a new process image - in other words it will 'kill' the current process and will execute a new (bash) under the current PID.





      Update: The -x/-e syntax is now deprecated - Ubuntu 18.04. The new recommended way is :



      gnome-terminal -- bash -c "<my command or script>; exec bash"



      • If you want to reach the users home directory within the above command use the environment variable $HOME: bash -c "cd $HOME/; ..."




      More examples of usage of this format:




      • Open a new terminal and source scripts

      • Launch gnome-terminal from SSH session to Desktop session

      • Start Specific Terminal on Startup

      • Crontab and C program that should be executed into a terminal window

      • Xdotool does not minimize terminal window when using in Startup Application when pc boots?







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Jan 20 at 13:35

























      answered Nov 9 '17 at 17:39









      pa4080pa4080

      13.9k52564




      13.9k52564













      • I got it. If I simply type gnome-terminal -x ./main it won't work. Cause "bash" is the parameter I have to pass to run ./main?

        – J.R.
        Nov 9 '17 at 17:41











      • @J.R. Here is a detailed explanation: askubuntu.com/a/967720/566421

        – pa4080
        Nov 9 '17 at 17:53











      • @J.R. I think gnome-terminal -x ./main shall work, but the terminal is closed too fast. Also using of /full/path/ is better than ./, you also could provide and working directory for the new gnome-terminal instance --working-directory='/home/<user>/.....

        – pa4080
        Nov 9 '17 at 18:19











      • nice. Thnx for the help. Still one small question. Can I set it to something like the console in a programming IDE? Like the console shows "type anything to continue", then if I type enter the console will be closed rather than typing "exit".

        – J.R.
        Nov 10 '17 at 7:28








      • 1





        Hi man I solved it myself by setting export PROMPT_COMMAND="exit"

        – J.R.
        Nov 10 '17 at 8:04



















      • I got it. If I simply type gnome-terminal -x ./main it won't work. Cause "bash" is the parameter I have to pass to run ./main?

        – J.R.
        Nov 9 '17 at 17:41











      • @J.R. Here is a detailed explanation: askubuntu.com/a/967720/566421

        – pa4080
        Nov 9 '17 at 17:53











      • @J.R. I think gnome-terminal -x ./main shall work, but the terminal is closed too fast. Also using of /full/path/ is better than ./, you also could provide and working directory for the new gnome-terminal instance --working-directory='/home/<user>/.....

        – pa4080
        Nov 9 '17 at 18:19











      • nice. Thnx for the help. Still one small question. Can I set it to something like the console in a programming IDE? Like the console shows "type anything to continue", then if I type enter the console will be closed rather than typing "exit".

        – J.R.
        Nov 10 '17 at 7:28








      • 1





        Hi man I solved it myself by setting export PROMPT_COMMAND="exit"

        – J.R.
        Nov 10 '17 at 8:04

















      I got it. If I simply type gnome-terminal -x ./main it won't work. Cause "bash" is the parameter I have to pass to run ./main?

      – J.R.
      Nov 9 '17 at 17:41





      I got it. If I simply type gnome-terminal -x ./main it won't work. Cause "bash" is the parameter I have to pass to run ./main?

      – J.R.
      Nov 9 '17 at 17:41













      @J.R. Here is a detailed explanation: askubuntu.com/a/967720/566421

      – pa4080
      Nov 9 '17 at 17:53





      @J.R. Here is a detailed explanation: askubuntu.com/a/967720/566421

      – pa4080
      Nov 9 '17 at 17:53













      @J.R. I think gnome-terminal -x ./main shall work, but the terminal is closed too fast. Also using of /full/path/ is better than ./, you also could provide and working directory for the new gnome-terminal instance --working-directory='/home/<user>/.....

      – pa4080
      Nov 9 '17 at 18:19





      @J.R. I think gnome-terminal -x ./main shall work, but the terminal is closed too fast. Also using of /full/path/ is better than ./, you also could provide and working directory for the new gnome-terminal instance --working-directory='/home/<user>/.....

      – pa4080
      Nov 9 '17 at 18:19













      nice. Thnx for the help. Still one small question. Can I set it to something like the console in a programming IDE? Like the console shows "type anything to continue", then if I type enter the console will be closed rather than typing "exit".

      – J.R.
      Nov 10 '17 at 7:28







      nice. Thnx for the help. Still one small question. Can I set it to something like the console in a programming IDE? Like the console shows "type anything to continue", then if I type enter the console will be closed rather than typing "exit".

      – J.R.
      Nov 10 '17 at 7:28






      1




      1





      Hi man I solved it myself by setting export PROMPT_COMMAND="exit"

      – J.R.
      Nov 10 '17 at 8:04





      Hi man I solved it myself by setting export PROMPT_COMMAND="exit"

      – J.R.
      Nov 10 '17 at 8:04













      0














      gnome-terminal -e cmd will open a terminal window and run cmd within it.






      share|improve this answer
























      • Hi. This is also the weird part with me. After I type "gnome-terminal -e ./main", an extra console is opened but I got a error and the program is not executed correctly. If I run it with built in program like "gnome-terminal -e ls", it seems somethings happened, but no extra console will be opened.

        – J.R.
        Nov 9 '17 at 17:27











      • @J.R. the command is executed but the terminal closes after it executes the command

        – lapisdecor
        Nov 9 '17 at 17:31











      • @lapisdecor ah, ok, so I should add something like "cmd -k" for genome as well?But why gnome-terminal -e ./main not working?

        – J.R.
        Nov 9 '17 at 17:36











      • try gnome-terminal -e "bash -c ls;bash"

        – lapisdecor
        Nov 9 '17 at 17:47
















      0














      gnome-terminal -e cmd will open a terminal window and run cmd within it.






      share|improve this answer
























      • Hi. This is also the weird part with me. After I type "gnome-terminal -e ./main", an extra console is opened but I got a error and the program is not executed correctly. If I run it with built in program like "gnome-terminal -e ls", it seems somethings happened, but no extra console will be opened.

        – J.R.
        Nov 9 '17 at 17:27











      • @J.R. the command is executed but the terminal closes after it executes the command

        – lapisdecor
        Nov 9 '17 at 17:31











      • @lapisdecor ah, ok, so I should add something like "cmd -k" for genome as well?But why gnome-terminal -e ./main not working?

        – J.R.
        Nov 9 '17 at 17:36











      • try gnome-terminal -e "bash -c ls;bash"

        – lapisdecor
        Nov 9 '17 at 17:47














      0












      0








      0







      gnome-terminal -e cmd will open a terminal window and run cmd within it.






      share|improve this answer













      gnome-terminal -e cmd will open a terminal window and run cmd within it.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 9 '17 at 17:10









      John AndersonJohn Anderson

      24029




      24029













      • Hi. This is also the weird part with me. After I type "gnome-terminal -e ./main", an extra console is opened but I got a error and the program is not executed correctly. If I run it with built in program like "gnome-terminal -e ls", it seems somethings happened, but no extra console will be opened.

        – J.R.
        Nov 9 '17 at 17:27











      • @J.R. the command is executed but the terminal closes after it executes the command

        – lapisdecor
        Nov 9 '17 at 17:31











      • @lapisdecor ah, ok, so I should add something like "cmd -k" for genome as well?But why gnome-terminal -e ./main not working?

        – J.R.
        Nov 9 '17 at 17:36











      • try gnome-terminal -e "bash -c ls;bash"

        – lapisdecor
        Nov 9 '17 at 17:47



















      • Hi. This is also the weird part with me. After I type "gnome-terminal -e ./main", an extra console is opened but I got a error and the program is not executed correctly. If I run it with built in program like "gnome-terminal -e ls", it seems somethings happened, but no extra console will be opened.

        – J.R.
        Nov 9 '17 at 17:27











      • @J.R. the command is executed but the terminal closes after it executes the command

        – lapisdecor
        Nov 9 '17 at 17:31











      • @lapisdecor ah, ok, so I should add something like "cmd -k" for genome as well?But why gnome-terminal -e ./main not working?

        – J.R.
        Nov 9 '17 at 17:36











      • try gnome-terminal -e "bash -c ls;bash"

        – lapisdecor
        Nov 9 '17 at 17:47

















      Hi. This is also the weird part with me. After I type "gnome-terminal -e ./main", an extra console is opened but I got a error and the program is not executed correctly. If I run it with built in program like "gnome-terminal -e ls", it seems somethings happened, but no extra console will be opened.

      – J.R.
      Nov 9 '17 at 17:27





      Hi. This is also the weird part with me. After I type "gnome-terminal -e ./main", an extra console is opened but I got a error and the program is not executed correctly. If I run it with built in program like "gnome-terminal -e ls", it seems somethings happened, but no extra console will be opened.

      – J.R.
      Nov 9 '17 at 17:27













      @J.R. the command is executed but the terminal closes after it executes the command

      – lapisdecor
      Nov 9 '17 at 17:31





      @J.R. the command is executed but the terminal closes after it executes the command

      – lapisdecor
      Nov 9 '17 at 17:31













      @lapisdecor ah, ok, so I should add something like "cmd -k" for genome as well?But why gnome-terminal -e ./main not working?

      – J.R.
      Nov 9 '17 at 17:36





      @lapisdecor ah, ok, so I should add something like "cmd -k" for genome as well?But why gnome-terminal -e ./main not working?

      – J.R.
      Nov 9 '17 at 17:36













      try gnome-terminal -e "bash -c ls;bash"

      – lapisdecor
      Nov 9 '17 at 17:47





      try gnome-terminal -e "bash -c ls;bash"

      – lapisdecor
      Nov 9 '17 at 17:47











      0














      You can simply do CTRLALTT and you will open a new terminal.



      Try gnome-terminal -e "bash -c command;bash"






      share|improve this answer






























        0














        You can simply do CTRLALTT and you will open a new terminal.



        Try gnome-terminal -e "bash -c command;bash"






        share|improve this answer




























          0












          0








          0







          You can simply do CTRLALTT and you will open a new terminal.



          Try gnome-terminal -e "bash -c command;bash"






          share|improve this answer















          You can simply do CTRLALTT and you will open a new terminal.



          Try gnome-terminal -e "bash -c command;bash"







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 9 '17 at 17:44

























          answered Nov 9 '17 at 17:14









          lapisdecorlapisdecor

          81941230




          81941230























              0














              Another approach that will keep the window open is to use xterm:



              xterm -hold -e cmd


              The hold option keeps the window open.






              share|improve this answer




























                0














                Another approach that will keep the window open is to use xterm:



                xterm -hold -e cmd


                The hold option keeps the window open.






                share|improve this answer


























                  0












                  0








                  0







                  Another approach that will keep the window open is to use xterm:



                  xterm -hold -e cmd


                  The hold option keeps the window open.






                  share|improve this answer













                  Another approach that will keep the window open is to use xterm:



                  xterm -hold -e cmd


                  The hold option keeps the window open.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 9 '17 at 17:47









                  John AndersonJohn Anderson

                  24029




                  24029























                      0














                      and if i want to execute with a superuser, what i will have to add?



                      Because i'm trying something like:
                      gnome-terminal -x bash -c "sudo /usr/local/sbin/smequeue; exec bash"






                      share|improve this answer








                      New contributor




                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





















                      • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – CentaurusA
                        2 hours ago
















                      0














                      and if i want to execute with a superuser, what i will have to add?



                      Because i'm trying something like:
                      gnome-terminal -x bash -c "sudo /usr/local/sbin/smequeue; exec bash"






                      share|improve this answer








                      New contributor




                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





















                      • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – CentaurusA
                        2 hours ago














                      0












                      0








                      0







                      and if i want to execute with a superuser, what i will have to add?



                      Because i'm trying something like:
                      gnome-terminal -x bash -c "sudo /usr/local/sbin/smequeue; exec bash"






                      share|improve this answer








                      New contributor




                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.










                      and if i want to execute with a superuser, what i will have to add?



                      Because i'm trying something like:
                      gnome-terminal -x bash -c "sudo /usr/local/sbin/smequeue; exec bash"







                      share|improve this answer








                      New contributor




                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      share|improve this answer



                      share|improve this answer






                      New contributor




                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      answered 9 hours ago









                      Ignasi OriolIgnasi Oriol

                      1




                      1




                      New contributor




                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





                      New contributor





                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






                      Ignasi Oriol is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.













                      • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – CentaurusA
                        2 hours ago



















                      • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – CentaurusA
                        2 hours ago

















                      If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                      – CentaurusA
                      2 hours ago





                      If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                      – CentaurusA
                      2 hours ago


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f974756%2fhow-can-i-open-a-extra-console-and-run-a-program-in-it-with-one-command%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      數位音樂下載

                      When can things happen in Etherscan, such as the picture below?

                      格利澤436b