Latest web development tutorials

Linux screen command

Linux command Daquan Linux command Daquan

Linux screen commands for multiple window management program.

Multi-screen window manager for the program. The so-called windows herein, refers to a full-screen text mode screen. Usually only when using telnet login host or using old-fashioned terminals, possible to use the screen program.

grammar

screen [-AmRvx -ls -wipe][-d <作业名称>][-h <行数>][-r <作业名称>][-s <shell>][-S <作业名称>]

Parameter Description:

  • -A All the windows are adjusted to the size of the current terminal.
  • -d <job name> specified screen work offline.
  • Buffer lines <rows> -h specified window.
  • -m even now in the job screen operation, the screen is still forced to create a new job.
  • -r <job name> to restore offline screen operation.
  • -R First attempts to restore offline job. If you can not find offline jobs, namely the establishment of a new screen operation.
  • -s <shell> specify when you create new windows, to be executed shell.
  • -S <Job name> Specifies the name of screen job.
  • -v Displays version information.
  • -x restore the previous screen work offline.
  • -ls or --list screen displays all current jobs.
  • -wipe check all current jobs screen and delete the job has been unable to use the screen.

Examples

Create screen terminal

# screen //创建 screen 终端

Create screen terminal and perform tasks

# screen vi ~/main.c //创建 screen 终端 ,并执行 vi命令

Leaving the terminal screen

# screen vi ~/main.c //创建 screen 终端 ,并执行 vi命令

#include 

main ()
{

}

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

在 screen 终端 下 按下 Ctrl+a d键

Reconnect the departure terminal screen

# screen -ls  //显示已创建的screen终端 
There are screens on:
2433.pts-3.linux	(2013年10月20日 16时48分59秒)	(Detached)
2428.pts-3.linux	(2013年10月20日 16时48分05秒)	(Detached)
2284.pts-3.linux	(2013年10月20日 16时14分55秒)	(Detached)
2276.pts-3.linux	(2013年10月20日 16时13分18秒)	(Detached)
4 Sockets in /var/run/screen/S-root.

# screen -r 2276 //连接 screen_id 为 2276 的 screen终端

Linux command Daquan Linux command Daquan