自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

再也不用擔(dān)心敲錯命令了

系統(tǒng) Linux
相信大家每個人都有敲錯過命令的時候,把python 輸入成 puthon. 手速過快把ls -alh 輸入成 ls a-lh等等等,這時候是不是想拍一下鍵盤說一聲fuck 。

[[441340]]

相信大家每個人都有敲錯過命令的時候,把python 輸入成 puthon. 手速過快把ls -alh 輸入成 ls a-lh等等等,這時候是不是想拍一下鍵盤說一聲fuck.

有一個同事就開發(fā)了一個thefuck的項(xiàng)目,可糾正先前控制臺命令中的錯誤。讓我們能愉快的工作下去.

安裝

在 macOS 或 Linux 上,您可以通過Homebrew安裝The Fuck: 

  1. brew install thefuck 

在 FreeBSD 上,使用以下命令安裝The Fuck:

  1. pkg install thefuck 

Centos系統(tǒng)/Ubuntu系統(tǒng) 

  1. pip install thefuck 

配置 

  1. #編輯bashrc配置文件  
  2. vim ~/.bashrc  
  3. #在文件尾加入一行給thefuck取別名fuck  
  4. eval "$(thefuck --alias fuck)"  
  5. #使生效  
  6. source ~/.bashrc 

Ubuntu安裝vim

忘記加sudo,fuck一下就好了. 

  1. apt-get install vim  
  2. E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)  
  3. E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?  
  4. ➜ fuck  
  5. sudo apt-get install vim [enter/↑/↓/ctrl+c]  
  6. [sudo] password for nvbn:  
  7. Reading package lists... Done 

git 首次push 

  1. ➜ git push  
  2. fatal: The current branch master has no upstream branch.  
  3. To push the current branch and set the remote as upstream, use  
  4.     git push --set-upstream origin master  
  5. ➜ fuck  
  6. git push --set-upstream origin master [enter/↑/↓/ctrl+c]  
  7. Counting objects: 9, done.  
  8. ... 

把python敲成puthon 

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

thefuck原理

其實(shí)TheFuck的原理就是規(guī)則匹配(正則表達(dá)式),如果找到匹配規(guī)則的命令,則創(chuàng)建一個命令給用戶選擇或直接運(yùn)行。 

  1. cat_dir - 當(dāng)你嘗試cat目錄的時候,用ls替換cat;  
  2. cd_correction – 拼寫檢查和糾正失敗的cd命令;  
  3. cd_mkdir – 在進(jìn)入目錄之前創(chuàng)建目錄;  
  4. cd_parent – 更改 cd.. 為cd ..;  
  5. dry – 修復(fù)類似的重復(fù)問題:git git push;  
  6. fix_alt_space – 用空格字符代替Alt + Space;  
  7. # 還有很多可以參考https://github.com/nvbn/thefuck#how-it-works  

 

責(zé)任編輯:龐桂玉 來源: 良許Linux
相關(guān)推薦

2020-06-15 08:03:17

大文件OOM內(nèi)存

2015-05-29 09:01:48

2024-01-26 07:00:11

Python工具無向圖

2021-08-13 22:38:36

大數(shù)據(jù)互聯(lián)網(wǎng)技術(shù)

2019-09-04 10:00:07

手機(jī)人臉識別

2015-10-22 10:38:43

Wi-Fi燃?xì)鈭?bào)警器

2021-06-08 07:48:26

數(shù)據(jù) Python開發(fā)

2021-06-11 07:14:04

QQ音樂微信翻譯

2022-09-14 08:02:25

加密算法Bcryp

2016-08-09 16:17:37

高德地圖TFBOYS大數(shù)據(jù)

2024-04-15 00:08:00

MySQLInnoDB數(shù)據(jù)庫

2020-04-30 09:01:27

路由器安全網(wǎng)絡(luò)安全路由器

2022-05-23 08:40:00

數(shù)據(jù)湖管理技術(shù)

2020-04-10 09:55:28

Git 工具黑魔法

2023-07-29 22:02:06

MyBatis數(shù)據(jù)庫配置

2018-08-29 14:56:42

SSD接口固態(tài)硬盤

2018-10-11 15:51:32

ChromeGoogle瀏覽器

2023-11-27 17:11:02

數(shù)據(jù)庫oracle

2022-06-01 10:09:39

Linux網(wǎng)絡(luò)延遲
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號