3 made it work on Ubuntu; fixed relative destination semantics; fixed space handling
source | link

I'd recommend these four steps:

cd ${SOURCE}; 
find . -type d -exec mkdir -p ${DEST}/\{} \; 
find . -type f -exec mv \{} ${DEST}/\{} \; 
find . -type d -empty -delete

or better yet, here's a script that implements semantics similar to mv:

#!/bin/bash

DEST=$DEST="${@:${#@}};"
ABS_DEST="$(cd "$(dirname "$DEST")"; pwd)/$(basename "$DEST")"

for SRC in ${@:1:$((${#@} -1))}; do   (
    cd $SRC;"$SRC";
    find . -type d -exec mkdir -p $"${DESTABS_DEST}"/\{} \; 
    find . -type f -exec mv \{} $"${DESTABS_DEST}"/\{} \; 
    find . -type d -empty -delete
) done

I'd recommend these four steps:

cd ${SOURCE}; 
find . -type d -exec mkdir -p ${DEST}/\{} \; 
find . -type f -exec mv \{} ${DEST}/\{} \; 
find . -type d -empty -delete

or better yet, here's a script that implements semantics similar to mv:

#!/bin/bash

DEST=${@:${#@}}; for SRC in ${@:1:$(({#@} -1))}; do   (
    cd $SRC;
    find . -type d -exec mkdir -p ${DEST}/\{} \; 
    find . -type f -exec mv \{} ${DEST}/\{} \; 
    find . -type d -empty -delete
) done

I'd recommend these four steps:

cd ${SOURCE}; 
find . -type d -exec mkdir -p ${DEST}/\{} \; 
find . -type f -exec mv \{} ${DEST}/\{} \; 
find . -type d -empty -delete

or better yet, here's a script that implements semantics similar to mv:

#!/bin/bash

DEST="${@:${#@}}"
ABS_DEST="$(cd "$(dirname "$DEST")"; pwd)/$(basename "$DEST")"

for SRC in ${@:1:$((${#@} -1))}; do   (
    cd "$SRC";
    find . -type d -exec mkdir -p "${ABS_DEST}"/\{} \;
    find . -type f -exec mv \{} "${ABS_DEST}"/\{} \;
    find . -type d -empty -delete
) done
2 added 1 character in body
source | link

I'd recommend these threefour steps:

cd ${SOURCE}; 
find . -type d -exec mkdir -p ${DEST}/\{} \; 
find . -type f -exec mv \{} ${DEST}/\{} \; 
find . -type d -empty -delete

or better yet, here's a script that implements semantics similar to mvmv:

#!/bin/bash

DEST=${@:${#@}}; for SRC in ${@:1:$(({#@} -1))}; do   (
    cd $SRC;
    find . -type d -exec mkdir -p ${DEST}/\{} \; 
    find . -type f -exec mv \{} ${DEST}/\{} \; 
    find . -type d -empty -delete
) done

I'd recommend these three steps:

cd ${SOURCE}; 
find . -type d -exec mkdir -p ${DEST}/\{} \; 
find . -type f -exec mv \{} ${DEST}/\{} \; 
find . -type d -empty -delete

or better yet, here's a script that implements semantics similar to mv:

#!/bin/bash

DEST=${@:${#@}}; for SRC in ${@:1:$(({#@} -1))}; do   (
    cd $SRC;
    find . -type d -exec mkdir -p ${DEST}/\{} \; 
    find . -type f -exec mv \{} ${DEST}/\{} \; 
    find . -type d -empty -delete
) done

I'd recommend these four steps:

cd ${SOURCE}; 
find . -type d -exec mkdir -p ${DEST}/\{} \; 
find . -type f -exec mv \{} ${DEST}/\{} \; 
find . -type d -empty -delete

or better yet, here's a script that implements semantics similar to mv:

#!/bin/bash

DEST=${@:${#@}}; for SRC in ${@:1:$(({#@} -1))}; do   (
    cd $SRC;
    find . -type d -exec mkdir -p ${DEST}/\{} \; 
    find . -type f -exec mv \{} ${DEST}/\{} \; 
    find . -type d -empty -delete
) done
1
source | link

I'd recommend these three steps:

cd ${SOURCE}; 
find . -type d -exec mkdir -p ${DEST}/\{} \; 
find . -type f -exec mv \{} ${DEST}/\{} \; 
find . -type d -empty -delete

or better yet, here's a script that implements semantics similar to mv:

#!/bin/bash

DEST=${@:${#@}}; for SRC in ${@:1:$(({#@} -1))}; do   (
    cd $SRC;
    find . -type d -exec mkdir -p ${DEST}/\{} \; 
    find . -type f -exec mv \{} ${DEST}/\{} \; 
    find . -type d -empty -delete
) done