Emacs Dired rename many files

[From]: http://stackoverflow.com/questions/15881776/emacs-dired-rename-many-files

This can easily be done using dired:

  1. Enter a dired view of your directory
  2. Switch to writable dired mode (wdired-change-to-wdired-mode): C-xC-q
  3. Edit the file names listing as if it were a normal buffer (for example using a keyboard macro or a rectangular selection or query-replace). Here is a regexp-based solution:


  4. Finish editing (wdired-finish-edit): C-xC-s or C-cC-c

You’re done!


Emacs: Rename Files Interactively

From http://ergoemacs.org/emacs/rename_file_pattern.html

Emacs: Rename Files Interactively

Buy Xah Emacs Tutorial. Master emacs benefits for life.

This pages shows you how to rename multiple files in emacs.

Go to the directory first, by calling dired. 〔➤ Emacs: File Management (dired tutorial)

When in dired, call dired-toggle-read-onlyCtrl+x Ctrl+q】.

Then, just edit the file names.

When done, do one of:

  • wdired-finish-editCtrl+c Ctrl+c】 to commit the changes.
  • wdired-abort-changesCtrl+c Ctrl+k】 to abort the changes.

How to quickly copy/move file in Emacs Dired?


From the documentation:

dired-dwim-target is a variable defined in `dired.el’. Its value is nil

Documentation: If non-nil, Dired tries to guess a default target directory. This means: if there is a Dired buffer displayed in the next window, use its current directory, instead of this Dired buffer’s current directory.

The target is used in the prompt for file copy, rename etc.

Put this in your init file: (setq dired-dwim-target t). Then, go to dired, split your window, split-window-vertically & go to another dired directory. When you will press C to copy, the other dir in the split pane will be default destination.

shareimprove this answer