I don't know if the title is self explanatory, but I wanted to have multiple (two for now would be enough) terminals open without having to start the Desktop.

I want to have a PHP script running (full-time) and be able to still use my Raspi terminal as it is when I start my Raspi with Raspbian.


7 Answers 7


Just use Alt + F1-F12, so you can have 12 different console tabs without starting a GUI

  • this is actually the option I currently use :)
    – pasadinhas
    Jul 24, 2014 at 14:51
  • 1
    This doesn't work on Raspbian, there's no login on any of the other ttys.
    – AndreKR
    Jul 23, 2019 at 18:50
  • On the latest raspbian, the key sequence to toggle virtual consoles is ALT+SHIFT+F1 ..., ALT+SHIFT+F6. Special case: ALT+SHIFT+F7 toggles to the desktop. Mar 9, 2022 at 14:11

If you're on the console (attached keyboard and screen) you should be able to use the Linux virtual console system to switch between multiple terminals using (ctrl-)alt-F1 through F12 and more with shift.

The number of terminals configured and the number of them having getty processes (that ask you for login and password) depends on configuration.

  • 3
    +1 because when directly connected to the machine, this is the "standard" way to get another login, and doesn't require installing screen/tmux..
    – Kiirani
    Apr 24, 2013 at 1:45

Even better than screen is (in my opinion) tmux. You can install it via sudo apt-get install tmux. Also check out the manpage with man tmux.

You can start it by typing tmux on one of your consoles (see XTL's answer).

Here are the most important commands (C-b d means: press control and B at the same time, then press D):

  • C-b d detach session
  • tmux attach on the shell to re-attach a running session
  • C-b " split the current frame horizontally (new shell is started)
  • C-b % split the current frame vertically (new shell is started)
  • C-b arrow (up, down, left, right) navigate between windows in current frame
  • C-b c new frame (new shell is started)
  • C-b n next frame
  • C-b l last frame
  • C-b b send C-b to the running application
  • Strong advocate for tmux here, too. Status line configuration is much more simple and it handles redraws better.
    – coxley
    Apr 15, 2013 at 22:33
  • 1
    Should be noted that tmux doesn't have the same behaviour as screen with regards to attaching the session to multiple VTs ("screen -x")
    – Kiirani
    Apr 24, 2013 at 1:43

You can do this with screen also. With screen, you can even detach from your screen session, logout, login, then reattach to your screen session without losing anything. Programs will continue to run, and all output will continue to be shown on the terminals that you disconnected from.

A couple of links to screen tutorials:



A link to a thread with some useful .screenrc tips:


A Raspberry Pi specific tutorial:


  1. If the php script you want to run doesn't interact with the user or needs input,

    you can use the & command which sends the script to the background

    Here is a example.

    pi@raspberrypi ~ $php code1 &

    This will send the script to the background where it will keep running.

  2. If you ssh into your terminal, then you can ssh in the same user twice and have two terminals.

  3. If you want to open multiple terminals from a ssh session,

    You should look at screen or even better install byobu which is a wrapper around screen.

    byobu is a wrapper that allows to easily open new screens with a simple function key instead of key combination from ctrl-a. It also shows a status line with all the open virtual terminals which can be named.

    Another nice feature is the fact that all your screen can stay up while your ssh connection is disconnected. You just connect again via ssh and call byobu and everything is like before.

Hope it helps.


For completeness, another option is to use byobu. It's a convenient layer on top of GNU screen. It provide nice defaults and it's in my sense easier to use. I personally use it on my Rapsberry Pi and it works just fine. To install it, just type:

$ sudo apt-get install byobu

Once installed, configure it via:

$ byobu-config

You can there choose to start it automatically when logging-in, and toggle status notification applets (uptime, load, date...)

enter image description here

As a side note, this kind of virtual console is also useful for sharing the same console input/output between different users on different machines (you can call it text mode screen sharing).

  • I tried byobou the other day and was not happy. The control via function keys was very flaky. Didn't work on OS X, also had problems when under Debian. I'll stick with tmux and its commands. The function keys also collide with mc (midnight commander).
    – Arne
    Apr 22, 2013 at 21:58
  • As for the function key conflict with mc, you can change them on byobu (you can easily select between two different modes via byobu-config). Jun 7, 2013 at 8:05

Since your original requirement was to launch a PHP script in the background, you can use the command nohup. Example:

$ nohup php myscript.php &

Once started, the command specified as a command-line argument to nohup is executed in the background, and its input/output are unlinked from the terminal who started it, to prevent the SIGHUP signal (hence the nohup name) to be sent to the background process when you quit the starting console (signal usually causing the program to quit). Output is redirected to a file (default nohup.out).

For more information: man nohup.

For a better and more complete answer, you may want to fully "daemonize" your program. You can probably find resources on the web which explain how to do it with PHP scripts.

  • Some shells (bash, zsh?) also have a command disown for preventing hanging up of selected background processes.
    – XTL
    Apr 29, 2013 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.