Move files and folders recursively on linux
Take this seriously
ls -al ../public-back
drwxrwxr-x 4 apache apache 4096 Apr 19 03:32 templates
ls -al ../public-back/templates
drwxrwxr-x 2 apache apache 4096 Apr 19 03:33 content
drwxrwxr-x 2 apache apache 20480 Apr 20 06:14 images
drwxrwxr-x 2 apache apache 4096 Apr 19 03:35 video
ls -al /public
drwxrwxr-x 4 apache apache 4096 Apr 20 09:49 templates
ls -al /public/templates
drwxrwxr-x 2 apache apache 4096 Apr 20 09:50 content
drwxrwxr-x 2 apache apache 4096 Apr 20 09:50 images
drwxrwxr-x 2 apache apache 4096 Apr 20 09:50 video
How do I move the contents of /public-back/templates
recursively with permissions into /public/templates
?
Best Answer
If i'm not wrong this will work
mv /public-back/templates/* /public/templates
Also, unless you have a huge list of files, adding -i
will ask before it overwrites anything, which add some safety when using wildcards like *
.