8

I have installed Ubuntu 12.04 LTS server .

How can i run more than .sh file in the same time (opening more than terminal)

I can use it on desktop version but i use server version.

Is it possible? if yes how can do?

Muath
  • 409

3 Answers3

12

By default Ubuntu has 7 ttys, on Server they are all command line (desktop the 7th is for X use) You can switch between then using Ctrl + Alt + F1 to Ctrl + Alt + F7

This would allow you run your script in 7 different sessions.

You can also background processes by starting them as normal, but appending an & to the end e.g.

yourscript.sh &

If your script does not terminate itself you will need to locate the pid and kill it, for more detail on killing read:

Manuel Jordan
  • 1,768
  • 7
  • 30
  • 50
NGRhodes
  • 9,490
  • but when i used & after sudo myscript.sh what happened is the same terminal started not in background any idea? or i'm doing it wrong? – Muath May 28 '14 at 10:28
2

Use screen. It's perfectly when you need multiple terminals. Specially when you are connected via ssh and you don't want to start another session.

You can, for example, run a command in it, detach, go to another machine, reattach and everything is still there.

Another similar application that provides the same is tmux.

chaos
  • 27,506
  • 12
  • 74
  • 77
1

Linux will process one process at a shell at a time, which means script running in your scenario.

At a same time if you need to do some other tasks through shell .. you can use other consoles from tty 1 to tty6.

tty 7 is GUI [ currently using Desktop ].

Move to tty 1 from current desktop. press ctrl + Alt + F1 . After that use Alt + F2 to go to tty 2 and follow upto F3 F4 F5 F6 and F7 for GUI

sivashanmugam
  • 117
  • 3
  • 3
  • 11