Provided by: manpages-zh_1.6.4.0-1_all 

名稱
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 的線上幫助: <https://www.gnu.org/software/coreutils/>
請向 <https://translationproject.org/team/zh_CN.html> 報告翻譯錯誤。
版權
Copyright © 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
<https://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.
參見
dirname(1), readlink(1)
完整文件請見: <https://www.gnu.org/software/coreutils/basename>
或者在本地使用: info '(coreutils) basename invocation'
跋
本頁面中文版由中文 man 手冊頁計劃提供。
中文 man 手冊頁計劃:https://github.com/man-pages-zh/manpages-zh
GNU coreutils 9.1 2022年9月 BASENAME(1)