20個最受歡迎的Linux命令

來源:互聯網
上載者:User

標籤:c   class   code   http   a   int   

http://code.csdn.net/news/2819566

 

1.   以 root 帳戶執行上一條命令

sudo !!

2.  利用 Python 搭建一個簡單的 Web 服務器,可通過 http://$HOSTNAME:8000訪問      

python -m SimpleHTTPServer

3. 切換到上一次訪問的目錄

cd -

4. 將上一條命令中的 foo 替換為 bar,並執行

^foo^bar

 5.   traceroute + ping   

mtr google.com

 6. 快速調用一個編輯器來編寫一個命令

ctrl-x e

 7. 執行一個命令,但不儲存在命令記錄中

<space>command

 8. 重新初始化終端

reset

9. 調出上次命令使用的參數

‘ALT+.‘ or ‘<ESC> .‘

 10. 以更加清晰的方式顯示當前系統掛載的檔案系統

mount | column -t

11. 在給定的時間執行命令

echo "ls -l" | at midnight

12. 通過DNS控制台查詢維基百科

dig +short txt <keyword>.wp.dg.cx

13. 從80連接埠向你本地的2001連接埠開啟隧道

ssh -N -L2001:localhost:80 somemachine

14. 快速存取ASCII表 

man ascii

15. 擷取你的外部IP地址

curl ifconfig.me

16. !! 表示重複執行上一條命令,並用 :gs/foo/bar 進行替換操作

!!:gs/foo/bar

 17. 輸出你的麥克風到遠程機器的擴音器

dd if=/dev/dsp | ssh -c arcfour -C [email protected] dd of=/dev/dsp

18. 掛載一個臨時的記憶體分區

mount -t tmpfs tmpfs /mnt -o size=1024m

 19. 以SSH方式掛載目錄/檔案系統

sshfs [email protected]:/path/to/folder /path/to/mount/point

20. 通過curl更新Twitter

curl -u user:pass -d status="Tweeting from the shell" <a href="http://twitter.com/statuses/update.xml">http://twitter.com/statuses/update.xml</a>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.