For faster navigation, this Iframe is preloading the Wikiwand page for rmdir.

rmdir

rmdirは、UnixMS-DOS(互換OSや、OS/2Windows等を含む)の、ディレクトリを削除するコマンドである。MS-DOS系では、rdという略称がエイリアスであるため、そちらが使われることが多い。

rmdir name_of_directory

ここでname_of_directoryは削除したいディレクトリ1つの名前である。ディレクトリの中身は空でなければならない[1]。Unixではこのコマンドに-pのようなオプションがある。これは、そのディレクトリの削除した結果、もし親ディレクトリも空になっていたら親ディレクトリも削除する。

例として、

rmdir -p foo/bar/baz

は最初にbaz/を、その後bar/を、そして最後にfoo/を削除する。つまりコマンド引数で指定したディレクトリツリー全体を削除する。

空ではないディレクトリを、その内容すべてごと再帰的に削除するにはrmコマンドの -r オプションを使う。例えば、

rm -r foo/bar/baz

DOSでこのコマンドと同じなのはdeltree、またはMicrosoft Windowsでは

rd /s directory_name

[編集]
  1. ^ 正確には、... だけでなければならない。

関連項目

[編集]

参照文献

[編集]

外部リンク

[編集]
{{bottomLinkPreText}} {{bottomLinkText}}
rmdir
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?