1

I want to run 2 commands from a single terminal

apt-get update && dpkg -L

not like that, I want to be able to enter one command that executes the same time as the second command in a second terminal

that might sound confusing, let me try another way

I want to be able to run for example:

firefox && apt-get upgrade

and have two different terminals open automatically and execute both of those commands just by running a terminal command, not a script

marked as duplicate by Sergiy Kolodyazhnyy command-line Jul 29 '18 at 2:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

You could type these commands after the $ prompt:

$ sudo apt update &
[1] 24966

$ firefox

[1]+  Stopped                 sudo apt update

The first command followed by & tells it to start in a second terminal (background session). The terminal immediately displays the process ID (24966) of the background session and prompts for another command. When the first command finishes you are notified in the terminal by:

[1]+  Stopped                 sudo apt update
  • no no no, i want two terminals to open by running one command, both terminals execute separate commands from the 1st terminal – user610658 Jul 29 '18 at 21:39
  • 1
    @hellomoto I've linked another question to this one, please see. The basic idea is that you can either run gnome-terminal -e "command" or open one window with multiple tabs each having its own command – Sergiy Kolodyazhnyy Jul 29 '18 at 22:47
  • @SergiyKolodyazhnyy "linked" or "hammered" ;) – WinEunuuchs2Unix Jul 29 '18 at 23:18
  • So long as it helps, either linking or hammering work :) – Sergiy Kolodyazhnyy Jul 29 '18 at 23:24
  • 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. – user610658 Jul 30 '18 at 0:11