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?

3 Answers 3

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:

1
  • 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
    Commented May 28, 2014 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.

0
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .