The Linux screen command is a versatile tool that allows you to run terminal applications in the background and switch back to them when needed. It supports split-screen displays and can be used over SSH connections, even after disconnecting and reconnecting. With screen, you can create new windows, run multiple processes, detach and reattach sessions, and share sessions between multiple users in real-time.
With the Linux screen
command, you can push running terminal applications to the background and pull them forward when you want to see them. It also supports split-screen displays and works over SSH connections, even after you disconnect and reconnect!
What Is the screen Command?
The screen
command is a terminal multiplexer, and it’s absolutely packed with options. To say it can do a lot is the granddaddy of understatements. The man page runs to over 4,100 lines.
The following are the most common cases in which you would use the screen
command, and we’ll cover these further in this article:
- The standard operation is to create a new window with a shell in it, run a command, and then push the window to the background (called “detaching”). When you want to see how your process is doing, you can pull the window to the foreground again (“reattach”) and use it again. This is great for long processes you don’t want to accidentally terminate by closing the terminal window.
- Once you’ve got a
screen
session running, you can create new windows and run other processes in them. You can easily hop between windows to monitor their progress. You can also split your terminal window into vertical or horizontal regions, and display your variousscreen
windows in one window. - You can connect to a remote machine, start a
screen
session, and launch a process. You can disconnect from the remote host, reconnect, and your process will still be running. - You can share a
screen
session between two different SSH connections so two people can see the same thing, in real-time.