script 命令 共享shell屏幕

来源:互联网 发布:淘宝网上怎样卖东西 编辑:程序博客网 时间:2024/05/21 10:28

在bash中, 有时需要把自己的屏幕共享到别人的终端上

可以借助管道来实现

需要分享屏幕的终端:

$ mkfifo my-fifo$ script -f my-fifo

需要查看屏幕的终端

$ cat my-fifo

script命令还可以录制自己的屏幕在其它shell中回放

录屏

[root@server tmp]# script -t 2> timing.log -a output.session

播放

[root@server tmp]# scriptreplay timing.log output.session

退出共享用exit命令即可

$ exit
0 0
原创粉丝点击