![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
文章轉自:編程派
有些命令確實挺方便,推薦給你們!python
1.ag:比 grep、ack 更快的遞歸搜索文件內容。mysql
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
2.tig:字符模式下交互查看 git 項目,能夠替代 git 命令。git
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
3.mycli:mysql 客戶端,支持語法高亮和命令補全,效果相似 ipython,能夠替代 mysql 命令。sql
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
4.jq: json 文件處理以及格式化顯示,支持高亮,能夠替換 python -m json.tool。typescript
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
5.shellcheck:shell 腳本靜態檢查工具,可以識別語法錯誤以及不規範的寫法。shell
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
6.yapf:Google 開發的 python 代碼格式規範化工具,支持 pep8 以及 Google 代碼風格。編程
7.mosh:基於 UDP 的終端鏈接,能夠替代 ssh,鏈接更穩定,即便 IP 變了,也能自動重連。json
8.fzf:命令行下模糊搜索工具,可以交互式智能搜索並選取文件或者內容,配合終端 ctrl-r 歷史命令搜索簡直完美。vim
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
9.PathPicker(fpp):在命令行輸出中自動識別目錄和文件,支持交互式,配合 git 很是有用。centos
運行如下命令:
git diff HEAD~8 --stat | fpp
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
10.htop: 提供更美觀、更方便的進程監控工具,替代 top 命令。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
11.axel:多線程下載工具,下載文件時能夠替代 curl、wget。
axel -n 20 http://centos.ustc.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
12.sz/rz:交互式文件傳輸,在多重跳板機下傳輸文件很是好用,不用一級一級傳輸。
13.cloc:代碼統計工具,可以統計代碼的空行數、註釋行、編程語言。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
14.ccache:高速 C/C++編譯緩存工具,反覆編譯內核很是有用。使用起來也很是方便:
gcc foo.c
改爲:
ccache gcc foo.c
15.tmux:終端複用工具,替代 screen、nohup。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
16.neovim: 替代 vim。
17.script/scriptreplay: 終端會話錄製。
script -t 2>time.txt session.typescript # 錄製開始# your commandsexit # 錄製結束
回放:
scriptreplay -t time.txt session.typescript
18.you-get: 很是強大的媒體下載工具,支持 youtube、google+、優酷、芒果 TV、騰訊視頻、秒拍等視頻下載。
還有 mac 專有的 pbcopy/pbpaste:
把命令行輸出拷貝到系統粘貼板:
cat test.sh| pbcopy
把系統粘貼板內容拷到終端:
pbpaste
mac 下的 say 命令支持多種語言(英語、普通話、粵語)文本朗讀,支持各類銷魂恐怖的語氣。跑這個命令感覺下,當心被嚇着了:
for i in `say -v '?' | cut -d ' ' -f 1`; do echo $i && say -v "$i" 'Hello World';done
19.thefuck:用途是每次命令行打錯了之後,打一句 fuck 就會自動更正命令。好比 apt-get 打成了 aptget。fuck 之後自動變成 apt-get。但仍是沒加 sudo。再 fuck,成功!
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
又好比 git branch 打成了 git brnch。fuck!更正成 git branch。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
又好比 python 打成了 puthon。fuck!一秒變 python。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
並且關鍵是每次打命令和心裏 os 徹底一致,有種人機合一的快感。fuck!
20.tldr: 若是你常常不想詳讀 man 文檔,那麼你應該試試這個小工具。
使用 $ man tar 時
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
使用 $ tldr tar 時
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)