Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I open a new window (shell) from command line in Linux?

I'm working with a tool right now that requires me to putty to a remote host, login, run a series of commands to start an engine, open a new window (and login again) to start a different engine, then open a third window (and again, login) to actually use the tool (leaving the engines running in those first two windows). I'd like to write a shell script to automate the process so that I could just open one window, type "sh whatever.sh" and be off and running, without physically opening the new windows and logging in again. However, I can't find a command to get me from one window to the next. Any thoughts?

like image 994
user832351 Avatar asked Jul 07 '11 13:07

user832351


3 Answers

You can just background the first processes by adding an ampersand (&) to the command line or pressing Ctrl+Z when it is running (and then enter bg to let the process continue, more information about that with jobs).

If that's not enough, you can create virtual shells with screen or tmux.

If you've redirected X (i.e. you can access GUIs over ssh), you can also just start a new window by executing your favorite (GUI) console program, like xterm, konsole, gnome-terminal, etc.

like image 93
phihag Avatar answered Oct 11 '22 00:10

phihag


Are you familiar with jobs on linux?

nohup whatever_1.sh &
nohup whatever_2.sh &
nohup whatever_3.sh &

Or perhaps screen would be of use here:

https://serverfault.com/questions/25301/job-control-and-ssh

See also, nohup:

http://en.wikipedia.org/wiki/Nohup

like image 4
Raoul Avatar answered Oct 10 '22 23:10

Raoul


The bash command opens a Bourne-again shell (bash) session.

like image 3
sfinley Avatar answered Oct 11 '22 00:10

sfinley