DEV Community

loading...

how to execute commands from another terminals by being on just one terminal

gauravpurswani profile image Gaurav Purswani ・1 min read

A)OPEN TERMINAL FROM TERMINAL

1.gnome-terminal

--terminal command to open terminal .

2.gnome-terminal -e [command]

--terminal command to open terminal and execute command in new terminal

3.gnome-terminal --command="bash -c '[command1]; [command2]; $SHELL'"

--bash -c tells it is a bash command
--command1 and command2 are commands to be executed on new terminal.
--$SHELL makes the terminal remain open to work on.

4.gnome-terminal --tab

--opens a new tab in the same terminal.

Discussion (2)

pic
Editor guide
Collapse
prashantnirgun profile image
Prashant Nirgun

I am using Ubuntu 18.04.4 LTS and using the following command

gnome-terminal --tab --title="Dev Server" --command="bash -c 'pwd; $SHELL'"

its showing --command is showing warning
Use “-- ” to terminate the options and put the command line to execute after it.

Collapse
gauravpurswani profile image
Gaurav Purswani Author

I'll be posting exiting things that we can Do in Linux