Open Gnome Terminal window and execute 2 commands
gnome-terminal
treats everything in quotes as one command, so in order to run many of them consecutively you need to start interpreter (usually a shell), and do stuff inside it, for instance:
gnome-terminal -e 'sh -c "echo test; sleep 10"'
BTW, you may want the window to stay open even after commands finish their job, in such case just start new shell, or replace a current with the new one:
gnome-terminal -e 'sh -c "echo test; sleep 10; exec bash"'
As of January 2020, the -e
option in gnome-terminal
still works, but throws the warning
# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.
You can run the two commands without warning with
gnome-terminal -- /bin/sh -c 'echo test; sleep 10'
And, as mentioned in this answer, if you want the window to stay open afterwards, you can do
gnome-terminal -- /bin/sh -c 'echo test; sleep 10; exec bash'
*answer to a similar question