Moving folder and subfolder to another path

The mv command doesn't have an -R flag, it moves folders recursively:

sudo mv fromPath/ toPath/

Edit

If you want a file not to be replaced, use the -i for being prompted in case a file with the same name exists.


For those trying to move folder, on Ubuntu using Putty, just use the following command:

sudo mv /fromPath/ /toPath/

for example:

sudo mv /root/folder1 /home/folder2/

"/" in the end means you are going to move folder1 inside folder2

If you don't, you will get "no such file or directory"


This worked for me:

mv src_folder target_folder/src_folder

i.e. not mv src_folder target_folder/