Renaming a directory, commonly referred to as a folder, is one of the most frequent administrative tasks performed in a Linux environment. Unlike operating systems that have a dedicated "rename" command for every basic action, Linux utilizes a more versatile tool called mv, which is short for move. This design philosophy stems from the fact that renaming a file or folder is essentially moving it from one name to another within the same file system hierarchy.

This guide provides a comprehensive look at how to rename folders using various methods, ranging from the classic command line to modern graphical user interfaces. It also covers advanced batch renaming techniques that are essential for developers and system administrators managing large-scale data.

Use the mv Command for Basic Renaming

The primary tool for renaming folders in Linux is the mv command. While its name suggests moving files from one location to another, it is the standard way to rename directories when the source and destination remain within the same parent folder.

Basic Syntax of the mv Command

The syntax for the mv command is straightforward. To rename a folder, the structure is as follows:

mv [OPTIONS] source_folder destination_folder

In this context, source_folder is the current name of the directory, and destination_folder is the new name you wish to assign to it. It is important to remember that Linux is case-sensitive. Therefore, a folder named Data is distinct from a folder named data.

Simple Renaming Example

If a user has a folder named old_project in their current working directory and wants to rename it to final_release, the command is: