Z
Z
zooks2017-07-09 19:16:06
linux
zooks, 2017-07-09 19:16:06

How to call a command from bash history starting on a specific line?

Hello.
As you know, when working in the terminal, arrows can call past commands.
But sometimes you have to scroll back 20 positions.
Is there a way to do this faster than grep history?
history | grep cd

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Cheremisin, 2017-07-09
@zooks

CTRL-r you press and start typing part of the command, pressing it again iterates through the found commands.
On the console after pressing CTRL-r it will be something like this

(reverse-i-search)`gre': grep 'item' gus.xml | wc -l

P
Pavel, 2017-07-09
@electronik777

command -> CTRL+UP in bash
command -> UP in csh

N
Night, 2017-07-09
@maxtm

Another option is to install zsh

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question