Ubuntu – How to make a script that opens terminal windows and executes commands in them

command linescriptsservices

I have three scripts I need to run when I start up my Ubuntu machine, they start services I use in my development environment.

To do that, I manually open three terminals and type in the commands.

Is there any way to create a script that will open three terminals and execute one command in each of these? (Each command should be in a separate terminal window so I can see their output).

Best Answer

gnome-terminal -- command

or

xterm -e command

or

konsole -e command

Pretty much

terminal -e command

To make the terminal stay when the command exits:

In konsole there is a --noclose flag.

In xterm, there is a -hold flag.

In gnome-terminal, go to Edit -> Profile Preferences -> Title. Click the Command tab. Select Hold the terminal from the drop-down menu labelled When command exits. You should create a new profile for that and execute with

gnome-terminal --window-with-profile=NAMEOFTHEPROFILE -e command