- Joined
- Mar 2, 2021
- Messages
- 13
- Reaction score
- 0
- Points
- 1
./source
./source/fol1
./source/fol1/file1.txt
./source/fol2
./source/fol2/file2.txt
./source/fol3
./source/fol3/file3.txt
./source/fol3/subfol
./source/fol3/subfol/subfile.txt
./dest
find source -type f -exec cp {} dest \;
./source
./source/fol1
./source/fol1/file1.txt
./source/fol2
./source/fol2/file2.txt
./source/fol3
./source/fol3/file3.txt
./source/fol3/subfol
./source/fol3/subfol/subfile.txt
./dest
./dest/file2.txt
./dest/file3.txt
./dest/file1.txt
./dest/subfile.txt
its partially correct, your output contains only files and not the subfolders in each folder.Here is what I did, created a folder called source that has your structure and dest is where I want all the files.
I started with:
I then ran the following command in the Terminal
Code:find source -type f -exec cp {} dest \;
You'll want to change the source and dest folder as you see fit.
Now I have the following
If you are not comfortable with the command line, please first validate what you are going to do and I can tell you if your command is right or wrong.
Is there any tool that can merge the contents of different folders into a single folder?
I'm obviously missing some important detail......a windows tool that works perfectly for me is: 2XDSOFT - Folder Merger
yes , but how do you do that in a quick way when you have 100 folders to merge?I'm obviously missing some important detail......
I just merged two folders on my Mac.
Opened one which had a long list of video files and also embedded folders.
Did a "Select All" and dragged the selected items to the folder I wanted the files and folders to merge with.
If the file or folder already existed on the target folder I would get an option to either replace the file/folder I'm moving or to skip.
You get that option.yes , but how do you do that in a quick way when you have 100 folders to merge?
the ideal would be to select all those 100 folders , define the destination folder and it will copy/merge in the destination folder in a serial way, so it ALWAYS overwrites the existing file
Yes, but it would also copy/paste the selected folder, i just want to select multiple folders and copy the contents of those folders (inner subfolders and files) not the actual selected folderYou get that option.
When the software detects a file/folder that already exists in the target folder, you can chose replace or skip and the also select to apply this to all files/folders being moved.
Just to be clear - I'm just talking about drag and drop, ie 'Select All", grab the highlighted items n drag & drop them to the folder where you want them.
I had several hundred videos, one batch on a 750GB external and another several hundred video files in a volume on another external - I movedall of them to a 2TB external eliminating all duplicates in the process.
I would suggest you try that on a small test sample.
I don't understand the problem.Yes, but it would also copy/paste the selected folder, i just want to select multiple folders and copy the contents of those folders (inner subfolders and files) not the actual selected folder
cd source_folder
cp -r -p */* ../destination_folder