击:我如何在一个屏幕会话的命令历史记录? [英] Bash: How do I get the command history in a screen session?

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

问题描述

如果我开始一个屏幕会话屏幕-dms名称,我怎么会访问该屏幕会话的命令历史记录使用脚本?

If I start a screen session with screen -dmS name, how would I access the command history of that screen session with a script?

使用<大骨节病>↑,最后执行出现,甚至在屏幕上。

Using the , the last executed command appears, even in screen.

推荐答案

屏幕不维护你键入的命令历史记录。你的shell可能或不可能保持历史。既然你似乎使用庆典,您可以使用历史命令。

screen doesn't maintain a history of the commands you type. Your shell may or may not keep a history. Since you appear to use bash, you can use the history command.

屏幕确实出现有历史记录搜索的粗略近似(它只是搜索的命令行滚动缓冲区。请参见屏幕下的历史命令手册页(绑定到钙{默认情况下)。

screen does appear to have a crude approximation of a history search (it merely searches the scrollback buffer for a command line. See the screen man page under the "history" command (bound to C-a { by default).

这篇关于击:我如何在一个屏幕会话的命令历史记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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