Scroll to navigation

BASENAME(1) 使用者命令 BASENAME(1)

名稱

basename - 去除檔名中的目錄與字尾

概述

basename 名稱 [字尾]
basename 選項... 名稱...

描述

列印已經移除所有目錄相關資訊後的(檔案)名稱。若特別指定,則同時移除指定的字尾名。

必選引數對長短選項同時適用。

支援多個引數,把每個引數看作一個(檔案)名稱來處理。
移除字尾;同時隱含 -a
使每行輸出以 NUL 字元結束,不新增換行符
顯示此幫助資訊並退出
顯示版本資訊並退出

範例

-> "sort"
-> "stdio"
-> "stdio"
-> "str1" 後接 "str2"

作者

由 David MacKenzie 編寫。

報告錯誤

GNU coreutils 的線上幫助: <https://www.gnu.org/software/coreutils/>
請向 <https://translationproject.org/team/zh_CN.html> 報告翻譯錯誤。

版權

Copyright © 2020 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

2020年三月 GNU coreutils 8.32