#执行第251号历史命令
[root@RedHat5 ~]# !251
nginx -s reload
#执行以ca开头的历史命令
[root@RedHat5 ~]# !ca
cat /usr/share/nginx/html/404.html nginx error !
#执行上条历史命令
[root@RedHat5 ~]# !!
echo abc abc
#双引号解析作用
[root@RedHat5 ~]# echo "nginx error!" > /usr/share/nginx/html/404.html
-bash: !": event not found
#echo -e 转义特殊字符
[root@RedHat5 ~]# echo -e "nginx error\!" > /usr/share/nginx/html/404.html
[root@RedHat5 ~]# cat /usr/share/nginx/html/404.html
nginx error\!
#单引号原样输出字符串
[root@RedHat5 ~]# echo 'nginx error !' > /usr/share/nginx/html/404.html
[root@RedHat5 ~]# cat /usr/share/nginx/html/404.html
nginx error !