mv command for directories

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
BiB
Level 2
Level 2
Posts: 69
Joined: Wed Jul 15, 2020 5:26 pm
Location: central EUROPE

mv command for directories

Post by BiB »

Yes... it's a very simple question, but why does this not work here:?

Code: Select all

root@Z440-powerhost:/home/data/rsync# mv -v /home/data/rsync/endeavour/endeavour /home/data/rsync/
mv: impossible de déplacer '/home/data/rsync/endeavour/endeavour' vers '/home/data/rsync/endeavour': Le dossier n'est pas vide
the French part means that the directory is not empty.

Is that a linux MINT 'feature' that I cannot mv directories?
confused?

Thanks :D :oops: :shock:
Last edited by LockBot on Sun Jan 01, 2023 11:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Love Linux OS
OS: Win10 custom & Feren OS & Linux Mint & Alpine
CPU: Intel Xeon E5-1650 v3 (12) @ 3.800GHz
Still kind of a newbie sometimes - so thanks for the help!
User avatar
xenopeek
Level 25
Level 25
Posts: 29597
Joined: Wed Jul 06, 2011 3:58 am

Re: mv command for directories

Post by xenopeek »

As the manual reads:

Code: Select all

   _Note_: ‘mv’ will only replace empty directories in the destination.
Conflicting populated directories are skipped with a diagnostic.
mv can't move a directory if a directory with the same name already exists at the target, and isn't empty. Moving the directory would otherwise cause the existing contents of the directory at the target to be deleted.

Because you already have an endeavour directory in /home/data/rsync/ you can't move the /home/data/rsync/endeavour/endeavour directory there. First remove the endeavour directory at /home/data/rsync/. Or instead of moving use copy, or rsync (smart copy).
Image
User avatar
BiB
Level 2
Level 2
Posts: 69
Joined: Wed Jul 15, 2020 5:26 pm
Location: central EUROPE

Re: mv command for directories

Post by BiB »

xenopeek wrote: Fri Jul 01, 2022 11:03 am As the manual reads:

Code: Select all

   _Note_: ‘mv’ will only replace empty directories in the destination.
Conflicting populated directories are skipped with a diagnostic.
mv can't move a directory if a directory with the same name already exists at the target, and isn't empty. Moving the directory would otherwise cause the existing contents of the directory at the target to be deleted.

Because you already have an endeavour directory in /home/data/rsync/ you can't move the /home/data/rsync/endeavour/endeavour directory there. First remove the endeavour directory at /home/data/rsync/. Or instead of moving use copy, or rsync (smart copy).
Hello XP,
:oops: Oh oh... Thanks a lot for that obvious explanation ^^
I must have been real tired :haha:

got it :idea:
Love Linux OS
OS: Win10 custom & Feren OS & Linux Mint & Alpine
CPU: Intel Xeon E5-1650 v3 (12) @ 3.800GHz
Still kind of a newbie sometimes - so thanks for the help!
Locked

Return to “Beginner Questions”