Using the mv
you can rename files or entire directories in CentOS.
Command: mv "original name" "new name"
Here is an example of a file being renamed in CentOS:
Below is a list of files within the “files” directory in my system. I want to rename “testfolder” to “important”
To rename “testfolder” type, mv testfolder important
in the terminal.
As you can see above, “testfolder” was succesfully changed to “important”
Here is an example of the same command working with a file as well:
“file” was changed to “thebestfile”
The “mv” command is universal across all Linux systems and will work with popular distros such as Ubuntu, Debian, etc.