Emacs: Batch Rename Files

By Xah Lee. Date: . Last updated: .

To rename multiple files in emacs, the most easy way is:

  1. Alt+x dired to go to the directory.
  2. Alt+x dired-toggle-read-onlyCtrl+x Ctrl+q】.
  3. Then, just edit the file names. (You can use Alt+x query-replace or Alt+x query-replace-regexp 〔see Emacs: Find Replace in Current File〕 or rectangle commands. 〔see Emacs: Edit Column Text, Rectangle〕)
  4. When done, wdired-finish-editCtrl+c Ctrl+c】 to commit the changes.

To abort, Alt+x wdired-abort-changesCtrl+c Ctrl+k】.

Emacs, File and Buffer