要获取到上一条命令的最后一个参数
root@ubuntu:/shell# ls /etc/hosts /etc/passwd /etc/hosts /etc/passwd root@ubuntu:/shell# echo $_ /etc/passwd
上面传输了两个参数
/etc/hosts
/etc/passwd
所以执行echo $_ 后就会输出/etc/passwd
shell 获取上一次命令最后参数
原文:http://caimengzhi.blog.51cto.com/9787265/1893836