gpt4 book ai didi

linux - screen执行 "long term"命令并获取日志

转载 作者:太空宇宙 更新时间:2023-11-04 05:13:36 38 4
gpt4 key购买 nike

我想从屏幕获取包含长期命令的日志,我尝试了几个选项,但不起作用。

(我通过 SSH/java 访问屏幕远程。)

这是代码:

screen -r new -X stuff "sudo apt-get update\n"
screen -x new -X hardcopy /home/user/new.log && cat new.log

响应sudo apt-get purge nginx -y

sudo apt-get purge nginx -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgd3 libvpx3 nginx-common nginx-core
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
nginx*
0 upgraded, 0 newly installed, 1 to remove and 84 not upgraded.
After this operation, 37.9 kB disk space will be freed.
(Reading database ... 82697 files and directories currently installed.)
Removing nginx (1.10.3-0ubuntu0.16.04.2) ...

您无法使用该命令获取更多日志。我想获得完整的日志。

命令执行成功。

提前致谢!

最佳答案

我确实道歉,该命令一切正常,只是我记得不好......我需要得到什么*例如。 nginx 安装。

关于linux - screen执行 "long term"命令并获取日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52219143/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com