日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

screen命令简介

發布時間:2023/12/31 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 screen命令简介 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、screen常用功能

? ?(1)會話恢復--最常用--使用運維工具網絡斷開后也可以恢復會話

? ?(2)會話共享--我在做操作,其他人也可以看見

? ?(3)多窗口


二、screen有什么用處?

? ? 假如我們正在運行一個程序,可能要跑幾個小時,但是中途斷網了,

在連接上去看不到程序的運行狀態,這時就可以用screen來創建會話了。

?

三、screen基礎命令

? [root@open*** ~]# screen -ls ?列出哪些程序在運行screen

? [root@open*** ~]# screen -S apache 啟動screen,給它加一個名字

? [root@open*** ~]# screen -x apache ?-x參數可以進入未斷開的會話

四、安裝screen

(1)[root@open*** ~]# rpm -qa | grep screen ?查詢本機是否安裝screen

? ? screen-4.0.3-18.el6.x86_64

(2)[root@open*** ~]# yum -y install screen ?安裝screen


(3)創建一個會話:

? [root@open*** ~]# screen -S apache


(4)查看創建的會話:

[root@open*** ~]# screen -ls

There is a screen on:

5410.apache (Attached)

1 Socket in /var/run/screen/S-root.

[root@open*** ~]#?

(5)測試 ?執行一個ping任務,然后斷開

? ?[root@open*** ~]# ping baidu.com

PING baidu.com (123.125.114.144) 56(84) bytes of data.

64 bytes from 123.125.114.144: icmp_seq=1 ttl=51 time=50.3 ms

64 bytes from 123.125.114.144: icmp_seq=2 ttl=51 time=50.1 ms

64 bytes from 123.125.114.144: icmp_seq=3 ttl=51 time=50.1 ms

64 bytes from 123.125.114.144: icmp_seq=4 ttl=51 time=50.1 ms

64 bytes from 123.125.114.144: icmp_seq=5 ttl=51 time=50.2 ms

64 bytes from 123.125.114.144: icmp_seq=6 ttl=51 time=50.2 ms


(6)恢復會話

[root@open*** ~]# screen -ls ?查看會話,名字是apache

There is a screen on:

5410.apache (Detached)

1 Socket in /var/run/screen/S-root.


[root@open*** ~]# screen -r apache 用-r參數恢復會話

64 bytes from 123.125.114.144: icmp_seq=77 ttl=51 time=50.1 ms

64 bytes from 123.125.114.144: icmp_seq=78 ttl=51 time=50.4 ms

64 bytes from 123.125.114.144: icmp_seq=79 ttl=51 time=50.4 ms

64 bytes from 123.125.114.144: icmp_seq=80 ttl=51 time=51.3 ms

64 bytes from 123.125.114.144: icmp_seq=81 ttl=51 time=53.4 ms

64 bytes from 123.125.114.144: icmp_seq=82 ttl=51 time=49.7 ms

64 bytes from 123.125.114.144: icmp_seq=84 ttl=51 time=50.2 ms

64 bytes from 123.125.114.144: icmp_seq=85 ttl=51 time=50.2 ms

64 bytes from 123.125.114.144: icmp_seq=86 ttl=51 time=50.2 ms

64 bytes from 123.125.114.144: icmp_seq=87 ttl=51 time=51.6 ms

64 bytes from 123.125.114.144: icmp_seq=88 ttl=51 time=52.2 ms


(7)[root@open*** ~]# screen -x apache ?-x參數可以進入未斷開的會話


轉載于:https://blog.51cto.com/cqtangbo/1752673

總結

以上是生活随笔為你收集整理的screen命令简介的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。