当您处于历史中间时,导航到历史记录中最早的/最新的命令 [英] Navigating to the earliest/latest command in history when you're in the middle of your history

查看:173
本文介绍了当您处于历史中间时,导航到历史记录中最早的/最新的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我在一个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

你正在寻找的东西:

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屋!

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