击:我如何在一个屏幕会话的命令历史记录? [英] Bash: How do I get the command history in a screen session?
问题描述
如果我开始一个屏幕会话屏幕-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屋!