[dirname] 手册页“Print NAME with its trailing /component removed; if NAME contains no /’s, output ‘.’ (meaning the current directory).”该命令可以取给定路径的目录部分(strip non-directory suffix from file name)。这个
Linux:使用libgen.h:basename,dirname basename以及dirname是两个命令: [test1280@localhost ~]$ which basename/bin/basename[test1280@localhost ~]$ which dirname/bin/dirname 可以通过: man 1 basenameman 1 dirname