618
johnDoe
8y

Oh yes I know how it feels.

Comments
  • 38
    Ctrl+r FFS
  • 13
    I grep for it in ~/.bash_history
  • 12
    @arantr This command is probably the most holy gift the Gods of terminals have given to us. Never thought I would say this, but the day I found this out is still in my memories.
  • 1
  • 1
    history | less
  • 2
    Personally, i use fish with vi shortcut. It saves me so much time :D
    Sometime it's like your terminal can read your mind XD
  • 8
    zsh is the holy grail for this, you start typing the command and press up and it gives you the last commands that start with the given text.
    Ex.: you did `tar -czf test.pdf test.tar` , if you type `tar` and press up it gives you the whole `tar -czf test.pdf test.tar` 😍
  • 3
    Totally relatable.. "I know I made this command not too long ago, so just scroll back a bit.. Or was that on the other server?"
  • 1
    @azous it's even better than you advertise. It gives you the last command containing the string, not just starting with. Love zsh!
  • 3
    I'd usually do; history | grep <command>
  • 1
    I love u fzf's (https://github.com/junegunn/fzf) replacement for Ctrl + R which allows you to fuzzy search in your history.
    Apart from being an awesome tool anyways.
  • 0
    404 post not found. Can't believe this passed 400 already
  • 2
    Definitely agree with ctrl+r and grepping bash_history. But I've always wanted this to just work: for when you overshoot the command with ctrl, use ctrl+s to go back, brilliant when it works without stty -ixon http://superuser.com/q/472846/...
  • 1
    @FractalSystems Thank you! That's gonna help me a lot :)
  • 0
    xD so its not only me 😂😂
  • 0
    Reverse search watahell people
  • 0
    $ cat ~/.initrc

    ## arrow up

    "\e[A":history-search-backward

    ## arrow down

    "\e[B":history-search-forward

    From: https://askubuntu.com/questions/...
Add Comment