0

I am running Ubuntu 19.04 (Disco). I use ctrl+alt+t to launch a terminal window. From that window, I would like to launch a separate window that runs a command, say ls. My thoughts are that I would type gnome-terminal -- ls and it would work, but it a new window is not launched.

That said, if I simply type in gnome-terminal and hit enter, a new window launches (but without running the command I would like to be run in a separate window.

The overall requirements are very strict, because what I what I am doing. (I am actually trying to launch this window via an ssh connection, running as root, in a root Desktop session)

1
  • I don't really understand the question. If I type gnorme-terminal in a terminal session, a new terminal window opens. So I am not clear.
    – John
    Feb 17, 2021 at 22:22

1 Answer 1

0

I'm assuming that you want the new gnome terminal to stay open indefinitely. If so, you can try something like:

gnome-terminal -- bash -c 'ls; exec bash'

The exec bash after the ls command ensures that the new terminal stays open, otherwise you can use the sleep command instead to have it close after a certain ammount of time:

gnome-terminal -- bash -c 'ls; sleep 30'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.