如何在屏幕会话中执行命令 [英] How to execute a command inside a screen session

查看:82
本文介绍了如何在屏幕会话中执行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在屏幕会话中执行命令. 我搜索了,发现了这个:

I would like to know how to execute a command inside a screen session. i searched and I found this :

screen -S nameofscreen -X stuff "command"

当我键入此命令时,该命令会在屏幕内键入,但不会执行. 所以我的问题是如何使用此命令按Enter键.

When I type this, the command is typed inside the screen but it is not executed. So my queston is how to press enter using this command.

推荐答案

bash shell中,您可以使用ctrl-V明确地将不可打印的字符放入字符串中.因此,请在命令末尾"之前尝试ctrl-V ctrl-L ctrl-V ctrl-M.

In the bash shell you can use ctrl-V to explicitly put non-printable characters into a string. So try ctrl-V ctrl-L ctrl-V ctrl-M at the end of your command just before the ".

这篇关于如何在屏幕会话中执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆