1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

-bash: /bin/rm: Argument list too long

Posted at

-bash: /bin/rm: Argument list too long というエラーは、rmコマンドを使用して非常に多くのファイルを一度に削除しようとしたときに発生します。シェルはコマンドライン引数の最大数に制限があり、この制限を超えるとエラーが発生します。

findコマンドを使用する

find . -type f -name "*.txt" -exec rm {} +

xargsを使用する

find . -type f -name "*.txt" | xargs rm
1
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?