4
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 5 years have passed since last update.

rmで.や..が使えないんですけど!?

Posted at

問題

$ rm -rf .

でファイルを削除しようとしたら、こんなエラーが

rm: refusing to remove ‘.’ or ‘..’ directory: skipping ‘.’

直訳すると、ディレクトリを削除するのに'.'や'..'は使えないってことか。

じゃあどうすれば良いんですかね?

解決編

その答えは簡単。
ディレクトリを直接指定してあげればいい。

$ ls
. .. a b c

$ rm -rf a b c

ζ*'ヮ')ζ<おるおっけー!!

参考記事

4
0
3

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
4
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?