惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Cloudbric
Cloudbric
G
GRAHAM CLULEY
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Spread Privacy
Spread Privacy
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
博客园_首页
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Latest news
Latest news
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
O
OpenAI News
J
Java Code Geeks
T
Tenable Blog
K
Kaspersky official blog
AWS News Blog
AWS News Blog
S
Security @ Cisco Blogs
The GitHub Blog
The GitHub Blog
T
Threatpost
月光博客
月光博客
H
Heimdal Security Blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Y
Y Combinator Blog
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
C
Cisco Blogs
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
C
CERT Recently Published Vulnerability Notes
D
Docker
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
V
Visual Studio Blog
H
Help Net Security

Rat's Blog - Linux

使用Instantbox快速搭建一个开箱即用的Web端临时Linux系统 - Rat's Blog Windows VPS一键重装为Linux系统 - Rat's Blog Linux VPS一键安装桌面环境和RDP远程桌面连接 - Rat's Blog Debian/Ubuntu使用update-rc.d命令添加/禁止开机启动项 - Rat's Blog Linux VPS纯净版CentOS系统一键安装脚本 - Rat's Blog NodeQuery:一款好看的Linux VPS服务器信息监控工具 - Rat's Blog Linux VPS利用iptables string模块屏蔽指定的网站、文件等 - Rat's Blog DomainMegaBot:Linux上最好用的批量扫描域名的工具 - Rat's Blog Debian安装PHP 7.2教程 - Rat's Blog
thefuck:Linux中一款可以自动纠正前一个命令行错误的工具 - Rat's Blog
博主: Rat's · 2018-03-17 · via Rat's Blog - Linux
  •  发布时间:
  •  18098 次浏览
  •   5 条评论
  •  1631 字数
  • 分类: 主机教程
  1.  首页
  2. 正文  
  3. 分享到:

简介

你是不是经常在终端敲错命令?敲错命令,删掉重敲,很烦有没有?当你一再敲错的时候,内心一定是崩溃的,一定在默念What The FUCK!。就这样thefuck神器就诞生了。thefuck不仅能修复字符输入顺序的错误,在很多别的你想说fuck的情况下,thefuck依然有效,反正只要你因为命令的问题报错,就请fuck一下。

截图

请输入图片描述

示例

1、命令拼写不对

# 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
Python 3.4.2

2、命令输错

# git brnch
git: 'brnch' is not a git command. See 'git --help'.

Did you mean this?
    branch

# fuck
git branch
* master

3、权限不够

# apt-get install vim
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

# fuck
sudo apt-get install vim
[sudo] password for nvbn:
Reading package lists... Done

安装

1、安装thefuck
运行以下命令:

#CentOS系统
yum -y update && yum -y install gcc 
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py && yum -y install python-devel
sudo -H pip install thefuck

#Ubuntu/Debian系统
sudo apt update
sudo apt install python3-dev python3-pip
sudo pip3 install thefuck

更多安装及使用方法查看Github项目地址:https://github.com/nvbn/thefuck

2、配置

#编辑bashrc配置文件
vim ~/.bashrc
#在文件尾加入一行
eval "$(thefuck --alias fuck)"
#使生效
source ~/.bashrc

最后使用fuck命令来纠正命令行拼写错误。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/545/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。