Instead of flagging a file with ‘D’, you can mark the file with some other character (usually ‘*’). Most Dired commands to operate on files use the files marked with ‘*’. The only command that operates on flagged files is x, which deletes them.
Here are some commands for marking with ‘*’, for unmarking, and for operating on marks. (See Dired Deletion, for commands to flag and unflag files.)
dired-mark). If the region is active, mark all files in the region instead; otherwise, if a numeric argument n is supplied, mark the next n files instead, starting with the current file (if n is negative, mark the previous −n files).
dired-mark-executables). With a numeric argument, unmark all those files.
dired-mark-symlinks). With a numeric argument, unmark all those files.
dired-mark-directories). With a numeric argument, unmark all those files.
dired-unmark). If the region is active, unmark all files in the region instead; otherwise, if a numeric argument n is supplied, unmark the next n files instead, starting with the current file (if n is negative, unmark the previous −n files).
dired-unmark-backward). If the region is active, unmark all files in the region instead; otherwise, if a numeric argument n is supplied, unmark the n preceding files instead, starting with the current file (if n is negative, unmark the next −n files).
dired-unmark-all-files). The argument is a single character—do not use <RET> to terminate it. See the description of the * c command below, which lets you replace one mark character with another.
With a numeric argument, this command queries about each marked file,
asking whether to remove its mark. You can answer y meaning yes,
n meaning no, or ! to remove the marks from the remaining
files without asking about them.
dired-next-marked-file) A file is “marked” if it has any kind of mark.
dired-toggle-marks): files marked with ‘*’ become unmarked, and unmarked files are marked with ‘*’. Files marked in any other way are not affected.
dired-change-marks). This command is the primary way to create or use marks other than ‘*’ or ‘D’. The arguments are single characters—do not use <RET> to terminate them.
You can use almost any character as a mark character by means of this command, to distinguish various classes of files. If old-markchar is a space (‘ ’), then the command operates on all unmarked files; if new-markchar is a space, then the command unmarks the files it acts on.
To illustrate the power of this command, here is how to put ‘D’ flags on all the files that have no marks, while unflagging all those that already have ‘D’ flags:
* c D t * c <SPC> D * c t <SPC>
This assumes that no files were already marked with ‘t’.
dired-mark-files-regexp). This command is like % d, except that it marks files with ‘*’ instead of flagging with ‘D’.
Only the non-directory part of the file name is used in matching. Use
‘^’ and ‘$’ to anchor matches. You can exclude
subdirectories by temporarily hiding them (see Hiding Subdirectories).
dired-mark-files-containing-regexp). This command is like % m, except that it searches the file contents instead of the file name. Note that if a file is visited in an Emacs buffer, this command will look in the buffer without revisiting the file, so the results might be inconsistent with the file on disk if its contents has changed since it was last visited. If you don't want this, you may wish reverting the files you have visited in your buffers, or turning on the
auto-revertmode in those buffers, before invoking this command. See Reverting.
dired-undo). This command does not revert the actual file operations, nor recover lost files! It just undoes changes in the buffer itself.
In some cases, using this after commands that operate on files can
cause trouble. For example, after renaming one or more files,
dired-undo restores the original names in the Dired buffer,
which gets the Dired buffer out of sync with the actual contents of