背景
你是不是经常在终端敲错命令?尤其是面对一些组合命令时是不是ctrl+c & v解决的同时仿佛感觉少了点什么?好的,thefuck隆重登场!
thefuck
thefuck是Vladimir Iakovlev大佬结合自身痛点打造的一款命令行神器,主要解决如下问题
- 命令拼写不对
- 命令拼写不对
- 权限问题
安装
安装需求
- python (2.7+ or 3.3+)
- pip
- python-dev
安装方法
Mac:
brew install thefuck
vim ~/.bashrc:
eval $(thefuck --alias)
# You can use whatever you want as an alias, like for Mondays:
eval $(thefuck --alias fuck)
Linux:
python -V //检查当前python版本
yum search python | grep python-dev //查看python-dev
yum install python-dev //安装python-dev
yum install python-pip //安装pip
sudo pip install thefuck //可以使用 pip 安装
安装后配置bash:
alias fuck='eval $(thefuck $(fc -ln -1)); history -r'
更新到最新的 thefuck 的方法非常简单:
sudo pip install thefuck --upgrade
网友评论