GNU Emacs Manual - Flagging Many Files

Node: Flagging Many Files Next: Dired Visiting Prev: Dired Deletion Up: Dired

Flagging Many Files

#
Flag all auto-save files (files whose names start and end with `#') for deletion (see Auto Save).

~
Flag all backup files (files whose names end with `~') for deletion (see Backup).

. (Period)
Flag excess numeric backup files for deletion. The oldest and newest few backup files of any one file are exempt; the middle ones are flagged.

% d regexp RET
Flag for deletion all files whose names match the regular expression regexp (dired-flag-files-regexp ).

The #, ~ and . commands flag many files for deletion, based on their file names. These commands are useful precisely because they do not actually delete any files; you can remove the deletion flags from any flagged files that you really wish to keep.

# flags for deletion all files whose names look like auto-save files (see Auto Save)---that is, files whose names begin and end with `#'. ~ flags for deletion all files whose names say they are backup files (see Backup)---that is, whose names end in `~'.

. (Period) flags just some of the backup files for deletion: all but the oldest few and newest few backups of any one file. Normally dired-kept-versions (not kept-new-versions ; that applies only when saving) specifies the number of newest versions of each file to keep, and kept-old-versions specifies the number of oldest versions to keep.

Period with a positive numeric argument, as in C-u 3 ., specifies the number of newest versions to keep, overriding dired-kept-versions . A negative numeric argument overrides kept-old-versions , using minus the value of the argument to specify the number of oldest versions of each file to keep.

The % d command flags all files whose names match a specified regular expression (dired-flag-files-regexp ). Only the non-directory part of the file name is used in matching. You can use `^' and `$' to anchor matches. You can exclude subdirectories by hiding them (see Hiding Subdirectories).


Next: Dired Visiting Up: Dired