Cygwin shortcut for command history

后端 未结 6 1650
难免孤独
难免孤独 2021-02-08 16:01

How can I search the command history in cygwin?

I don\'t want to keep pressing the arrow keys to execute a command from console command history.

6条回答
  •  生来不讨喜
    2021-02-08 16:15

    I think one of the easiest way is to pipeline it with less and press search character ("/") and then type the command you wanna find.

    history | less
    

    and then

    /text to find
    

    to find the desired command

    Another way

    is to append the stdout form history command to a file: history > /cygdrive/path/file.txt

    and then search in the document.

提交回复
热议问题