I'm drawing a blank right now and am looking for an answer to a simple question...
How do you move folders to a new location with the same name, combining the contects of each folder into one?
For example, lets say you had this directory structure with files inside each folder....
/cd1/RedHat/RPMS/
/cd1/base/
/cd2/RedHat/RPMS/
/cd2/base/
How would you move everything under /cd2/ to /cd1/, including any folders, subfolders, and files in one command? You could do this with mv, but you'll need a separate command for every single folder like this....
mv /cd2/RedHat/RPMS/* /cd1/RedHat/RPMS/
mv /cd2/base/* /cd1/base/
You can't just do this...
[root@tux tmp]# mv cd2/* cd1/
mv: cannot overwrite directory `cd1/base'
mv: cannot overwrite directory `cd1/RedHat'
I could use 'cp -a cd2/* /cd1/' and then delete cd2/, but I'm looking for a way to do this with a single command.
Thanks
How do you move folders to a new location with the same name, combining the contects of each folder into one?
For example, lets say you had this directory structure with files inside each folder....
/cd1/RedHat/RPMS/
/cd1/base/
/cd2/RedHat/RPMS/
/cd2/base/
How would you move everything under /cd2/ to /cd1/, including any folders, subfolders, and files in one command? You could do this with mv, but you'll need a separate command for every single folder like this....
mv /cd2/RedHat/RPMS/* /cd1/RedHat/RPMS/
mv /cd2/base/* /cd1/base/
You can't just do this...
[root@tux tmp]# mv cd2/* cd1/
mv: cannot overwrite directory `cd1/base'
mv: cannot overwrite directory `cd1/RedHat'
I could use 'cp -a cd2/* /cd1/' and then delete cd2/, but I'm looking for a way to do this with a single command.
Thanks