Merging multiple folders

command linefinderfolders

I have multiple folders within a folder. Each of these folders contains only files (no subfolders). None of the files have duplicate file names.

Is it possible to merge all of the folders to concatenate the files together in a single folder? I could only find information about the ditto command, which seems to be for merging only two folders.

Best Answer

cd containing_folder
mv */* .

or, if you want to get rid of the empty folders afterwards

cd containing_folder
mkdir ../foo
mv */* ../foo/
rmdir *
mv ../foo/* .
rmdir ../foo