1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Ubuntu】ディレクトリを中身ごと削除する方法

Last updated at Posted at 2020-11-02

rmdir -r が使えない

CentOSなどでよく使う rmdir -r を使おうとすると

$ rmdir -r test/
rmdir: invalid option -- 'r'
Try 'rmdir --help' for more information.

オプションが無いと怒られます。

実行方法

フォルダの中身を削除→ディレクトリを削除という方法で落ち着きました。

フォルダの中身(ディレクトリ含む)を削除

$ rm -r ./*

ディレクトリを削除

$ rmdir test/
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?