十個酷斃的Linux單行命令!

1. sudo !!    python

  以 root 帳戶執行上一條命令。

2. python -m SimpleHTTPServer
   利用 Python 搭建一個簡單的 Web 服務器,可經過 http://$HOSTNAME:8000 訪問。

3. :w !sudo tee %
   在 Vim 中無需權限保存編輯的文件。

4. cd -
   更改到上一次訪問的目錄。

5. ^foo^bar
   將上一條命令中的 foo 替換爲 bar,並執行。

6. cp filename{,.bak}
   快速備份或複製文件。

7. mtr google.com
   rtaceroute+ping。

8. !whatever:p
   搜索命令歷史,但不執行。

9. $ssh-copy-id user@host
   將 ssh keys 複製到 user@host 以啓用無密碼 SSH 登錄。

10. ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq/tmp/out.mpg
    把 Linux 桌面錄製爲視頻。服務器

相關文章
相關標籤/搜索