PDA

View Full Version : merging directories in linux


rocksea
24th July 2006, 10:15 AM
I have a folder with several subdirectories.
I want to put all the files in all these subdirectories to one directory.
(i.e. move/copy just the files without copying the directory structure)
Does anybody know of any method to merge these directories to one?

I tried $rsync dir1 dir2 .. targetdir

but it created new subdirectories in the target directory..

koldunovn
24th July 2006, 03:44 PM
maybe if directories have similar names ( result01 result02 result03 ...) you can make a script with a loop. :occasion5

rocksea
25th July 2006, 12:24 PM
ya, using a shell script can be thought of..

then, even if the names are not similar, one can make a directory list and feed into the loop,,