🧀 Learn Linux

Advanced · Organize files

rename: Batch rename based on expression

Syntax

rename expression file…

Examples

rename "s/\.txt$/.md/" *.txt

Usage and sandbox support

For review only: practice in a real Linux environment, this sandbox does not execute this command. This example uses Perl rename; the syntax of tools of the same name may vary between distributions.

This command is for reference and review, and the simulation terminal does not provide corresponding exercises yet.

Full documentation ↗

Related commands