thefuck是一个使用Python编写的开源小工具,它可以自动纠正前一个命令的拼写错误。这个工具非常酷,尤其对于常常使用命令行的童鞋

  • thefuck支持Mac OS X和Linux系统。
  • 安装步骤:

    • ubuntu

      1
      2
      sudo apt install python3-dev python3-pip
      pip3 install --user thefuck (or sudo -H pip3 install thefuck)
    • macOs

      1
      brew install thefuck
  • 用法:

    • 先alias一个别名,别名随便

      1
      2
      3
      vim  .vimrc or .bashrc
      eval "$(thefuck --alias fuck)"
      source ~/.vimrc or ~/.bashrc
    • 示例:

      1
      2
      3
      4
      5
      6
      7
      8
        ➜ puthon
      No command 'puthon' found, did you mean:
      Command 'python' from package 'python-minimal' (main)
      Command 'python' from package 'python3' (main)
      zsh: command not found: puthon
      ➜ fuck
      python [enter/↑/↓/ctrl+c]
      Python 3.4.2 (default, Oct 8 2014, 13:08:17)

Git地址
更多用法请参考README