查看base那么命令的帮助:
root@OpenWrt:/# basename --help
BusyBox v1.22.1 (2015-09-15 16:38:30 CST) multi-call binary.
Usage: basename FILE [SUFFIX] 这个是basename的用法
Strip directory path and .SUFFIX from FILE 出去路径(和后缀名),只显示文件名
例如:
root@OpenWrt:/# basename /tmp/hbg/test.jpg
test.jpg
root@OpenWrt:/# basename /tmp/hbg/test.jpg .jpg
test
root@OpenWrt:/# basename /tmp/hbg/test.jpg jpg
test.
root@OpenWrt:/#