Scroll to navigation

DIRNAME(1) ユーザーコマンド DIRNAME(1)

名前

dirname - ファイル名の最後の要素を削除する

書式

dirname [OPTION] NAME...

説明

NAME の最後の / (スラッシュ) 以降の要素 (/ を含む) を削除して表示します。 NAME に / が含まれない場合は、(カレントディレクトリを意味する) '.' を表示します。

出力行の区切りとして改行文字ではなく NUL を使用します。
使い方を表示して終了します。
バージョン情報を表示して終了します。

-> "/usr"
-> "dir1" の後に "dir2"
-> "."

作者

作者 David MacKenzie および Jim Meyering。

バグのレポートについて

バグのレポートは 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 © 2025 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.

関連項目

basename(1), readlink(1)

完全なマニュアルは <https://www.gnu.org/software/dircolors> か、
ローカルで有効になっていれば info '(coreutils) dircolors invocation' です。

日本語訳

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

2025/09 GNU coreutils 9.8