1. 5
  1.  

  2. 3

    There’s an error in this article in “Enter last argument from previous command(s)”:

    $? is the exit code of the last command. !$ is the last argument of the last command. Similarly !! repeats the entire last command (e.g. if you forgot to sudo, you can sudo !!).

    1. 1

      To add to this point, Alt+. or Esc+. works for me to insert last argument, not Ctrl+.

    2. 2

      Ctrl+r: Reverse search through your command history. Kinda like pushing the up arrow with search.

      Ctrl+c: kill/interupt the current running process. If you don’t want it to print ^C every time you press it you can add set echo-control-characters Off to your ~/.inputrc file.

      Here’s my ~/.inputrc contents, I rarely ever use Ctrl+r:

      # use up and down arrow to match search history based on typed starting text
      "\e[A": history-search-backward
      "\e[B": history-search-forward
      # Ctrl+d to clear filenames in backward direction
      # Esc+Backspace stops at _ . etc
      "\C-d": unix-filename-rubout
      
      # when using Tab for completion, ignore case
      set completion-ignore-case on
      # single Tab press will complete if unique, display multiple completions otherwise
      set show-all-if-ambiguous on
      
      1. 1

        If prepending sudo is important enough that you’d write a zsh script for it, check out thefuck!