How do I Use Multiple Screens on One Terminal over ssh session?
Most of the time GUI is not available on remote Linux system, you login over ssh and start to work, if you need to run two or three task at a time, you login over ssh two or three times. However, with screen windows manager utility you can run multiple terminals at the same time from single console login over ssh session (UNIX guru uses the term called multiplexing for this concept). Any seasoned Linux admin should be aware of this nifty tool
(A) Install screen if it is not installed under Debian Linux:
# apt-get install screen
Note: FreeBSD user can use ports to install screen
# cd /usr/ports/misc/screen
# make install clean
(B) Login to remote server over ssh
$ ssh me@myserver.com
(C) Start screen session. You can name your window/session (1 is name of session):
$ screen -S 1
Let us start pine mail reader on first session or window.
$ pine
(D) Next you would like to download something from ftp/http site while you are reading emails. You need to create another screen window by pressing special key combination. Press CTRL + a followed by c key (first hit CTRL+a, releases both keys and press c). As soon as you hit 'c' you will get new shell prompt at console. Now use wget to download belenix.iso.bz2 (Solaris live CD) from net:
$ wget http://www.genunix.org/distributions/belenix_site/binfiles/belenix.iso.bz2
(E) But how do I switch between these two tasks?
- Switching between windows is the specialty of screen utility. So to switch between pine and wget window (or session) press CTRL+a followed by n key (first hit CTRL+a, releases both keys and press n).
- To list all windows use the command CTRL+a followed by " key (first hit CTRL+a, releases both keys and press " ).
- To switch to window by number use the command CTRL+a followed by ' (first hit CTRL+a, releases both keys and press ' it will prompt for window number).
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- Linux screen command tutorial / how to
- Shell tip: Clear the command history and screen when you log out
- Howto: Linux Refresh all or an X screen Kde-Gnome desktop
- setsid: Keep Linux / UNIX program running while you logs out
- nixCraft FAQ Roundup
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: debian_linux, linux_admin, linux_system, multiplexing, nifty_tool, screen_windows, ssh_session, windows_manager



Recent Comments
Today ~ 5 Comments
Today ~ 12 Comments
Today ~ 2 Comments
Today ~ 18 Comments
Today ~ 5 Comments