Back to Blog
Arnošt Havelka

The Rename Command

Give files new names.

Start Interactive Lesson
The Rename Command

The ren (or rename) command is straightforward: it changes the name of a file. It cannot move files to a different directory; for that, you need move.

Try the command

Try renaming a file!

Build the command
ren
filenameThe current name of the file.
newnameThe new name for the file. Note: You cannot specify a new path here.
Terminal
C:\Users\User>ren old.txt new.txt

Real-World Examples

Simple rename:

Command Prompt
C:\Users\User>ren raw_data.csv data_2024.csv

Bulk rename extensions:

Command Prompt
C:\Users\User>ren *.htm *.html

Knowledge Check

1 / 2

Can 'ren' move a file to another folder?

References

These documentation links provide authoritative details for the commands used in this article.

Up Next

Practical: Echo Files

Real-world scenario: Creating logs and config files.