• tal
    link
    fedilink
    English
    arrow-up
    18
    ·
    edit-2
    1 day 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
      ·
      1 day 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!