Subject: Feature request: rm -ir variant not asking about directories

From: [email-masked] (Niels Möller)
Date: Wed, 26 Sep 2018 11:19:31 +0200

I have a large directory tree where most but not all directories are
empty, and where I might want to keep a few of the existing files.

I can use rm -ir to get rm to ask me for each file if it should be
deleted. But it also asks questions like

  rm: descend into directory 'foo'?
  rm: remove directory 'foo'?

to which I'd always say yes (and then attempts to delete any non-empty
directory fails with a clear warning message).

It would be less tedious if the questions about directories were
suppressed. A reasonable command line flag might be 

  --interactive=non-dir

(If there are any entries which are niether files nor directories, e.g,
a named pipe, I'd want rm to ask, hence "non-dir" rather than "file").

Another variant which would be useful is to traverse a directory tree
and recursively delete all empty directories, without asking any
questions. Would make sense as a --recursive/-r flag to rmdir, rather
than a new option to rm.

I'm using GNU coreutils 8.28, which doesn't seem to have these features.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.