rename
A cheatsheet by @rstacruz|Refreshed 7 months ago.Refresh|View source on Github

Regex substitution

Regex substitution

rename 's/hello/world/' *.txt

Rename hello.txt to world.txt and so on in *.txt.

Replace extension

Replace extension

rename -s .png .jpg.png *.png

Replace .png with .jpg.png in *.png.

Options

Options

Option Description
-n Simulation
-l Symlink instead of rename
-i Interactive