Emacs: Batch Rename Files
To rename multiple files in emacs, the most easy way is:
- Alt+x
dired
to go to the directory. - Alt+x
dired-toggle-read-only
【Ctrl+x Ctrl+q】. - Then, just edit the file names. (You can use Alt+x
query-replace
or Alt+xquery-replace-regexp
〔see Emacs: Find Replace in Current File〕 or rectangle commands. 〔see Emacs: Edit Column Text, Rectangle〕) - When done,
wdired-finish-edit
【Ctrl+c Ctrl+c】 to commit the changes.
To abort, Alt+x wdired-abort-changes
【Ctrl+c Ctrl+k】.