BASENAME

Section: ユーザーコマンド (1)
Updated: 2025/09
Index JM Home Page roff page
 

名前

basename - ファイル名からディレクトリと接尾辞を取り除く  

書式

basename ,名前 /[,接尾辞/]
basename ,オプション/... ,名前/...  

説明

パス名からディレクトリ部分を取り除いた名前を表示します。指定があれば、末尾の接尾辞も取り除きます。

長いオプションで必須となっている引数は短いオプションでも必須です。

-a, --multiple
引数を複数をとり、各引数を NAME として扱います。
-s, --suffix=,SUFFIX/
末尾にある 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。  

バグのレポートについて

バグのレポートは bug-coreutils@gnu.org までお寄せ下さい。
GNU coreutils のホームページ: <https://www.gnu.org/software/coreutils/>
一般的な GNU ソフトウェア使用に関するヘルプは <https://www.gnu.org/gethelp/> です。
翻訳に関するバグは <https://translationproject.org/team/ja.html> に連絡してください。  

著作権

Copyright © 2020 Free Software Foundation, Inc. ライセンス 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' です。  

日本語訳

対応バージョン:9.8 翻訳日:2025-11-08 翻訳者:ribbon


 

Index

名前
書式
説明
作者
バグのレポートについて
著作権
関連項目
日本語訳

This document was created by man2html, using the manual pages.