名称

dirname - 去除文件名的最后一个组成部分

概述

dirname [选项] 名称...

描述

将每个名称的最后一个非斜线的组成部分与后缀的斜线移除并输出;如果所给名称不包含斜线 '/',则输出 '.'(即代表当前目录)。

-z, --zero
使每行输出以 NUL 字符结束,不添加换行符
--help
显示此帮助信息并退出
--version
显示版本信息并退出

范例

dirname /usr/bin/
-> "/usr"
dirname dir1/str dir2/str
-> "dir1" 后接 "dir2"
dirname stdio.h
-> "."

作者

由 David MacKenzie 和 Jim Meyering 编写。

报告错误

GNU coreutils 的在线帮助: <http://www.gnu.org/software/coreutils/>
请向 <http://translationproject.org/team/zh_CN.html> 报告 dirname 的翻译错误。

版权

Copyright © 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

参见

basename(1), readlink(1)


完整文档请见: <http://www.gnu.org/software/coreutils/dirname>
或者在本地使用: info aq(coreutils) dirname invocationaq


This document was created by man2html, using the manual pages.
Time: 14:42:02 GMT, August 11, 2015