rmdir - ディレクトリを削除する
rmdirコマンドを使用すると、ディレクトリを削除することができます。
rmdir ディレクトリ名
ディレクトリが空でない場合は、削除することができません。
ディレクトリが空でない場合に、削除するには?
rmdirコマンドは、ディレクトリの内容が空の場合のみ、削除することができます。
ディレクトリが空でない場合に削除するには「rmコマンド」の「-r」オプションを使用します。
rmコマンドの解説をご覧ください。
ヘルプを表示する --helpオプション
ヘルプを表示するには「--help」オプションを使用します。
rmdir --help
ヘルプが表示されます。
Usage: rmdir [OPTION]... DIRECTORY...
Remove the DIRECTORY(ies), if they are empty.
--ignore-fail-on-non-empty
ignore each failure that is solely because a directory
is non-empty
-p, --parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c' is
similar to `rmdir a/b/c a/b a'.
-v, --verbose output a diagnostic for every directory processed
--help display this help and exit
--version output version information and exit
Linuxサーバー管理入門