Score:-1

Reset search history to search from the start with CTRL + r

gb flag

When I use CTRL + R in Linux, the command history is searched from the last finding.

How do I reset the search, so that I am able to search from the start?

terdon avatar
cn flag
Can you elaborate a bit please? Do you mean you want to find the _oldest_ match first?
pLumo avatar
in flag
I don't really think this is possible, if you want more advanced history funciton, you should check out [`fzf`](https://github.com/junegunn/fzf).
guiverc avatar
cn flag
You've not provided any OS/release details, nor what terminal/shell you're asking about. I do what you're asking about regularly, but how done can vary on details you didn't provide. Note: on some I exit the search & hit ^R again.. but it varies on shell at a minimum.
terdon avatar
cn flag
@pLumo Actually, bash does have a `forward-search-history` function (see `Commands for Manipulating the History` in `man bash`) but it's mapped to `Ctrl+S` by default which blocks input on most terminals.
24601 avatar
in flag
I usually address the problem by using a different letter I know existed in an earlier command with `Ctrl+r`.
Score:0
ca flag

To do more advanced searching than provided by CTRL+R:

$ man history tells about a good deal of options.
but then,
$ history | grep search-terms might be easier to understand, as it is more "standard"

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.