Emacs: Batch Rename Files
To rename multiple files in emacs, the most easy way is:
- Alt+x
diredto 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-replaceor Alt+xquery-replace-regexp〔see Emacs: Find Replace〕 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】.