The rsync command is the best tool for merging directory contents, as it is designed to synchronize files and directories recursively and efficiently, merging contents rather than attempting a direct overwrite of the directory itself.
-a: Archive mode, which preserves permissions, ownership, timestamps, and recursively copies directories.
-v: Verbose output (optional, but helpful to see progress).
rsync -av /path/to/source_dir/ /path/to/destination_dir/
same command using copy (cp)
cp -r /path/to/source_dir/* /path/to/destination_dir/
After using rsync to merge the contents, you can safely remove the original source directory using rm -rf.
rm -rf /path/to/source_dir