Windows 10, Emacs 25.1, Dired+

If I want to delete files in Dired mode I have 2 options:

  1. Flag files for deletion (by pressing d) and then delete them by pressing x
  2. Mark files by m and then delete them by pressing D

What are the differences between these approaches? Why are both options available?

  • I can't speak for Dired+, but in vanilla Dired D does not mark files - it actually deletes either the current or all marked files.
    – Basil
    Commented Dec 6, 2017 at 14:53
  • @Basil: There's no difference between Dired+ and vanilla Dired here. The OP wrote D when meaning d.
    – Drew
    Commented Dec 6, 2017 at 16:09
  • @Drew Ah yes, it didn't occur to me. Thanks.
    – Basil
    Commented Dec 6, 2017 at 16:12

1 Answer 1


There's no difference in terms of what happens (the files will be deleted) so you can use whichever approach fits your work flow.

Flagging (d, dired-flag-for-deletion) is specifically for deleting a number of files at once. Having a two-step process (flag, delete) is a safety mechanism so you can see what is about to be deleted. This is particularly useful when you might be deleting things based on a pattern (using ~, ., % d, etc) -- you have a chance to make sure the pattern wasn't too broad.

Marks (m or * m, dired-mark) provide a general mechanism for operating on a set of files. In this case delete is just one of the many actions that are possible on the marked set of files. I imagine delete is included here as a convenience and because it would just seem like an oversight if you could take any action on marked files except deleting them.

The marking commands also let you build your set of files in more complex ways. For example, it's often useful to mark some set of files, then use * t to toggle the marks so you can delete all the files that did not match.

The other benefit of having two separate commands is that you can use flag/delete to delete a couple files without affecting files you have marked for some other purpose. For example, you might mark a bunch of files so that you can search across them, but then decide there are a couple you just want to delete. You can flag/delete those and then keep searching through your marked set.

I use both of these mechanisms, depending on what I'm trying to do. I probably use marks most often, since its more flexible. I'll use flag/delete for simple things where I just want to delete a couple specific files or all the ~/# backup files in a directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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