0

Emacs 26.1, Dired+, Windows 10

Suppose I has the next dir tree:

myproject
myproject\app\
myproject\app\build
myproject\app\src
myproject\lib\build
myproject\lib\src
myproject\lib2\build
myproject\lib3\build
myproject\lib3\src

I want to delete folders build in all subfolders. After delete the result must be like this.

myproject
myproject\app\
myproject\app\src
myproject\lib\
myproject\lib\src
myproject\lib2\
myproject\lib3\
myproject\lib3\src

Is it possible? And is it possible in dired mode?

2

In Dired:

  • You can use D (command dired-do-delete) to delete all marked files and subdirectories in the current Dired listing

  • You can use M-+ D (command diredp-do-delete-recursive) to delete all marked files and subdirectories, found recursively. (This one is Dired+ only).

User option dired-recursive-deletes controls whether deletion of non-empty directories is allowed.

You can also use commands like these, to mark files and subdirectories:

  • % m (dired-mark-files-regexp)
  • M-+ % m (diredp-mark-files-regexp-recursive)
  • % g (dired-mark-files-containing)
  • M-+ % g (diredp-mark-files-containing-regexp-recursive)

You can also use various commands in find-dired.el and find-dired+.el, to list files that satisfy certain conditions, found recursively. (You can then mark some of them and act on the marked ones.)

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.