Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
recursive option has been implemented for mv only partially. It is possible to move a source directory and its contents to a destination directory if there is no directory with the same name as source in the destination. Otherwise it complains "mv SOURCE to TARGET; unable to remove target: Is a directory". Apparently the mv command is too stupid to know that there is a possibility to skip removing the target and instead continue on moving the contents recursively. This makes people like me upset as there is no other simple command-line solution to achieve exactly the same behaviour.
Simple enough?
By the way, the GNU tools are open source, if you really need that function just because you don't want to use to commands for that functionality feel free to extent the mv command.
Simple enough?
By the way, the GNU tools are open source, if you really need that function just because you don't want to use to commands for that functionality feel free to extent the mv command.
"cp -r $SOURCE $DESTINATION && rm -r $SOURCE" is not a good option when you want to move big directories between different computers, which take long and there might be interruption. you are right nevertheless, for the moment I complained so that if somebody is more expert and has the time to do it ;-).
Edit:
This option is already implemented in nautilus, which is gpl licenced as well. It asks if you want to merge the folders or not, and there is a apply-to-all check-box. But one have to dig into the codes to transfer the functionality to the mv command
If you are worrying about interruptions substitute cp with rsync in that command, it copies only files that are different and can use compression if needed (and appliable).
mv and cp are simply not the right tools for that.
Thank you very much for your help. The rsync command, specially when used with --remove-source-files option does exactly what I want. (well hopefully, haven't tested it yet)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.