Why do you move instead of renaming the folder?

Hello, I have 1TB of occupied space, and every time I have to rename the folder, instead of renaming I think it moves it, the last time I made it from the console with mv name_folder new_name and it takes more than 8 hours, because it does not rename it it moves it, now I’m doing it from and it’s the same, why does it take so long? it’s supposed to be renaming not moving


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I have decided not to use spaces anymore due to such behaviors of spaces like renaming a directory! or slow moving thousands of files.

Use this:

mv -T namefolder newfolder

In that case, namefolder will not be moved into newfolder if newfolder is a directory. However, if both namefolder and newfolder are directories and newfolder is empty, namefolder will be renamed to newfolder (and the original newfolder removed). If both are directories and newfolder is non-empty, mv -T will complain.

With -T, namefolder is renamed to newfolder, but without -T, namefolder is moved into the directory pointed to by newfolder.