• Lazycog@sopuli.xyz
    link
    fedilink
    arrow-up
    24
    ·
    4 days ago

    This is why I follow linux memes, I don’t know if I have ever bumped into CTRL+R but I finally can let go of

    history
    
    • tal@lemmy.today
      link
      fedilink
      English
      arrow-up
      19
      ·
      edit-2
      4 days ago

      If you haven’t used them before, there’s also ! and ^.

      ! invokes the last command starting with the following string.

      ^ searches for the last command containing the first string, replaces that string with the second, and invokes that.

      $ ls *.mp4
      Episode_One.mp4  Episode_Two.mp4
      $ !l
      ls *.mp4
      Episode_One.mp4  Episode_Two.mp4
      $ ^mp4^mp3
      ls *.mp3
      music.mp3
      $
      
      • Lazycog@sopuli.xyz
        link
        fedilink
        arrow-up
        5
        ·
        4 days ago

        I used !<index> Together with history by giving an index displayed in the history list, but did not know that you can use it like that! Also didn’t know about ^

        Thanks for the tips!

      • tal@lemmy.today
        link
        fedilink
        English
        arrow-up
        8
        ·
        edit-2
        4 days ago

        The default ones are the same as in emacs, so if you know emacs, you probably know them too, but Control-U kills (roughly equivalent to “cut” for non-emacs people) from the cursor to the beginning of the line, which emacs doesn’t do; that defaults to something like M-- M-1 C-k in emacs.

        If you’re a vi person, you can do set -o vi and use vi functionality. Hit Esc to go into vi-style command mode.

      • Lazycog@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        4 days ago

        I feel like I forget those that I just don’t use often enough, and when I would need them I default to what I know (which is always a slower way than knowing a shortcut) in a “hurry”.

        Guess I should just print them and tape the paper next to my monitor.