Skip to content
Advertisement

“Too many open files” – can’t remove a directory

I’ve created a large tree of empty directories in an Android emulator, around 1024.

enter image description here

Now whenever I try to remove it with rm -rf 1/ I get a “Too many open files” error. How can I remove it?

Advertisement

Answer

  1. Please try to use ulimit to set the open file handle as 4000 or more, you can use “ulimit -a” to show the current limitation of open files.
  2. Please remove the deepest folder first, then rm them one by one
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement