Ubuntu – Run command on another(new) terminal window

command lineexecute-commandgnome-terminal

How to run any command in another terminal window?

Example: I opened one terminal window and if I run command like apropos editor, then it run and out-puts on that window. But I want to run same command on another terminal window (new window) instead on present window from first terminal.

Further clarification:

I need suggest-command <command> that open new terminal window and run mentioned <command> in that (newly opened) window. (where suggest-command is example of suggestion of command.)

How to do that?

Best Answer

This might be what you search:

gnome-terminal -e "bash -c \"!!; exec bash\""

or (shortly):

gnome-terminal -x sh -c "!!; bash"

It opens gnome-terminal with your last command (!!) executed and it stays open with the command output in the shell, even with an interactive command like top or less...

In your case its:

gnome-terminal -e "bash -c \"apropos editor; exec bash\""

or

gnome-terminal -x sh -c "apropos editor; bash"
Related Question