How to Change a File Name in Linux: Commands, Options, and When to Use Each

Renaming files in Linux is straightforward once you understand the tools available — but the right approach depends on whether you're working in a terminal, renaming one file or thousands, and how comfortable you are with the command line. Here's what you need to know.

The Core Command: mv

The primary way to rename a file in Linux is the mv command (short for "move"). Despite the name, when you use mv on a file within the same directory, it renames it rather than moving it anywhere.

Basic syntax: