当您处于历史中间时,导航到历史上最早/最新的命令 [英] Navigating to the earliest/latest command in history when you're in the middle of your history
本文介绍了当您处于历史中间时,导航到历史上最早/最新的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我在一个 bash 终端中并且有大量的命令历史.我按了很多次向上箭头,并且处于历史的中间".我现在想快速导航到历史记录中的第一个或最后一个命令(无需长时间按住向上或向下箭头).这可能吗?如果有,实现这个的快捷键是什么?
Say I am in a bash terminal and have a large history of commands. I pressed the up arrow a whole bunch of times and am in the "middle" of the history. I want to now navigate to the first or the last command in my history quickly (without holding down the up or the down arrow for a long time). Is this possible? If so, what is the shortcut key to achieving this?
推荐答案
看看手册页:
man bash
我在这里为你复制了你要找的东西:
Here I copied for you the thing you were looking for:
previous-history (C-p)
Fetch the previous command from the history list, moving back in the list.
next-history (C-n)
Fetch the next command from the history list, moving forward in the list.
beginning-of-history (M-<)
Move to the first line in the history.
end-of-history (M->)
Move to the end of the input history, i.e., the line currently being entered.
这篇关于当您处于历史中间时,导航到历史上最早/最新的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文