---
title: "Ten Amazing Linux Commands"
author: "standalone"
date: "2010-11-08T22:42:42Z"
tags: []
categories: ["编程语言"]
slug: "ten-amazing-linux-commands"
draft: false
lastmod: "2010-11-08T22:42:42Z"
id: 806072
url: "https://standalone.iteye.com/blog/806072"
---

01. `sudo !!`
    
    以 root 帐户执行上一条命令。
02. `python -m SimpleHTTPServer`
    
    利用 Python 搭建一个简单的 Web 服务器，可通过 http://$HOSTNAME:8000 访问。
03. `:w !sudo tee %`
    
    在 Vim 中无需权限保存编辑的文件。
04. `cd -`
    
    更改到上一次访问的目录。
05. `^foo^bar`
    
    将上一条命令中的 foo 替换为 bar，并执行。
06. `cp filename{,.bak}`
    
    快速备份或复制文件。
07. `mtr google.com`
    
    traceroute + ping。
08. `!whatever:p`
    
    搜索命令历史，但不执行。
09. `$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 桌面录制为视频。