moving dir subdir and files

I have created a directory structure and under the directory subdirectories and files are there.I need to move the entire thing
to another path.How can i write a script to do that.

currently the path of files is as below :
/data1/serial/mcycle/archive : under this path differnt sub dir exist

i want to move everything to /data2/mycle

Why write a script? Why not just issue a mv on it/them?

Also please generally use

```text
 and 
```

tags when posting data, code, logs etc. ty.

can we do this in a single piece of command...i want all the directories...its subdirectories and the files in that to be copied

I don't know your directory structure but you can surely just move directory by directory or use wildcards. Everything based below them will be moved together with them. If you are not familiar with the mv command you should test it out creating example structures with copying something you have already or using mkdir and touch.

This should do what you required, "move all the files and subdirectories under archive to destination mycle".

mv /data1/serial/mcycle/archive /data2/mycle

Or you were expecting some thing else ?

let me explain the exact requirement...

source : /data1/serial/mcycle/archive : under archive there are many directories and sub directories...but unfortunately archive dir is created in one user(say X) and rest are under other user(say Y).

Now we need to change the owner of archive to Y as X id will be removed.So i was thinking of taking a backup and moving files again...

Please suggest ..

Backup is not moving more copying. You can use something like that to create an exact copy:

cd /source
find .| cpio -dumpv /destination

No offense but commands like mv, cp etc. are everyday commands of a Unix admin. I recommend strongly that you get somewhat familiar with those by playing around with them on a test box and reading some manuals.