Is there a way to perform what rsync does (compiles many directories into a single directory) - But instead of copying files/sub-directories I need it to create a directory with symlinks that point to the original files/sub-directories.

link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

Your question is ambiguous.

cp -l "$SRCDIR"/* "$DESTDIR"

find "$SRCDIR" -mindepth 1 \( -type d -printf 'mkdir "$DESTDIR/%P"\n' \) -o \
  \( -printf 'cp -l "%p" "$DESTDIR/%P"\n' \) | DESTDIR="$DESTDIR" bash

The first creates symlinks to the various items directly in $SRCDIR. The second recreates the directory structure and creates symlinks to the non-directories.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.