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 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.
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...
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.