To rename a directory in Linux, you can use the mv command (short for "move"). Here's how you can do it:
Open a terminal on your Linux system.
Navigate to the parent directory of the directory you want to rename using the cd command. For example, if the directory you want to rename is located at /home/user/oldname, you can use the following command to navigate to its parent directory:
cd /home/user/
Once you are in the parent directory, use the mv command followed by the current directory name and the desired new name. For example, if you want to rename the directory "oldname" to "newname," you would use the following command:
mv oldname newname
Press Enter to execute the command.
The mv command is primarily used for moving files and directories, but it can also be used to rename directories by specifying a new name for the directory. Note that if the new name you specify already exists in the current directory, the mv command will overwrite it.