Why do you move instead of renaming the folder?

Posted March 3, 2018 2.1k views
DebianBlock Storage

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 namefolder newname 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

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.

Submit an Answer
1 answer

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.