GNU coreutils 8.26
manpages-zh
Chinese manual pages
man-pages-zh-CN
Chinese Man Pages from Chinese Man Pages Project
man-pages-zh_cn
Simplified Chinese Linux man pages
coreutils
The basic file, shell and text manipulation utilities of the GNU operating system
coreutils-common
coreutils common optional components
coreutils-doc
Documentation for the GNU Core Utilities
名称
basename - 去除文件名中的目录与后缀
概述
basename \,名称 \/[\,后缀\/]
basename \,选项\/... \,名称\/...
basename \,选项\/... \,名称\/...
描述
打印已经移除所有目录相关信息后的(文件)名称。若特别指定,则同时移除指定的后缀名。
必选参数对长短选项同时适用。
-a, --multiple | |
支持多个参数,把每个参数看作一个(文件)名称来处理。 | |
-s, --suffix=\,后缀\/ | |
移除后缀;同时隐含 -a | |
-z, --zero | 使每行输出以 NUL 字符结束,不添加换行符 |
--help | 显示此帮助信息并退出 |
--version | |
显示版本信息并退出 |
范例
basename /usr/bin/sort | |
-> "sort" | |
basename include/stdio.h .h | |
-> "stdio" | |
basename -s .h include/stdio.h | |
-> "stdio" | |
basename -a any/str1 any/str2 | |
-> "str1" 后接 "str2" |
作者
由 David MacKenzie 编写。
报告错误
GNU coreutils 的在线帮助: <http://www.gnu.org/software/coreutils/>
请向 <http://translationproject.org/team/zh_CN.html> 报告 basename 的翻译错误。
请向 <http://translationproject.org/team/zh_CN.html> 报告 basename 的翻译错误。
版权
Copyright © 2016 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.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
参见
dirname(1), readlink(1)
完整文档请见: <http://www.gnu.org/software/coreutils/basename>
或者在本地使用: info \(aq(coreutils) basename invocation\(aq
或者在本地使用: info \(aq(coreutils) basename invocation\(aq
跋
本页面中文版由中文 man 手册页计划提供。
中文 man 手册页计划:https://github.com/man-pages-zh/manpages-zh
中文 man 手册页计划:https://github.com/man-pages-zh/manpages-zh