查看和执行历史命令

    查看 history

    1. [root@centos ~]# history
    2. 1 ls
    3. 2 cd
    4. 3 cd /
    5. 4 ls
    6. 5 cd tmp/

    重复执行历史命令
    上一次历史命令

    1. 向上方向键
    2. 输入!!(英文感叹号)
    3. 输入!-1(无空格)
    4. Ctrl+P

    叹号定位法
    不适用,不可能去.bash_history中专门查看
    搜索定位法
    Ctrl+R
    多次Ctrl+R可在切换结果
    回车执行
    http://c.biancheng.net/linux/history.html