0

I am deleting a directory which has almost 600 nested directories inside it using rm -rf <directory name> . This command is showing error : File name too long.

I tried find <path to directory> -type d -delete but this shows directory not empty error.

How to delete such directory?

1 Answer 1

0

There is most definitly at least one softlink or a mountpoint involved - else the kernel would not have allowed creation of the files.

  • If it is a link: delete the files from the original path.
  • If it is a mountpoint: mount to a shorter path

You can also do it by hand: cd into a "halfway" directory, then rm -rf *, then step back and repeat.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .