Removing Infinitely Nested Directories

Try rm -rf to avoid the prompting.

-f, --force           ignore non-existent files, never prompt

A very secure way would be - if your find supports -delete - to use find for deleting:

find -type d -name 27-Jan -empty -delete

Since -delete implies -depth, it will first walk down the tree to directory 3275, delete it, step up one step, now 3274 is empty too, and can be deleted, step up to 3273 and so on...

man find:

   -depth Process each directory's contents before the directory itself.
          The -delete action also implies -depth.

You can remove directory hierarchies recursively using -r switch of rm

-r, -R, --recursive
              remove directories and their contents recursively

So issuing

rm -r 27-Jan

should get rid of the directory. Unless you have already tried that, of course. In that case, could you specify the error you get?

Tags:

Directory

Rm

Osx