Easy Tutorial
❮ Linux Shell Variable Linux Comm Comm ❯

Linux screen Command

Linux Command Manual

The Linux screen command is used for multi-window management.

Screen is a multi-window manager that runs in a full-screen text mode. It is typically used when logging into a host via telnet or using an older terminal.

Syntax

screen [-AmRvx -ls -wipe][-d <job_name>][-h <lines>][-r <job_name>][-s <shell>][-S <job_name>]

Parameter Description:

Examples

Create a screen terminal

# screen // Create a screen terminal

Create a screen terminal and execute a task

# screen vi ~/main.c // Create a screen terminal and run the vi command

Detach from a screen terminal

# screen vi ~/main.c // Create a screen terminal and run the vi command

#include 

main ()
{

}

"~/mail.c"       0,0-1    

Press Ctrl+a d in the screen terminal

Reconnect to a detached screen terminal

# screen -ls  // Display created screen terminals
There are screens on:
2433.pts-3.linux    (October 20, 2013 16:48:59)    (Detached)
2428.pts-3.linux    (October 20, 2013 16:48:05)    (Detached)
2284.pts-3.linux    (October 20, 2013 16:14:55)    (Detached)
2276.pts-3.linux    (October 20, 2013 16:13:18)    (Detached)
4 Sockets in /var/run/screen/S-root.

# screen -r 2276 // Connect to the screen terminal with ID 2276

Linux Command Manual

❮ Linux Shell Variable Linux Comm Comm ❯