Last active
March 3, 2023 18:38
-
-
Save beaulac/dd352ca183c90df40beb99ad7cf2fdba to your computer and use it in GitHub Desktop.
Flatten all files in a directory (recursive) as symlinks in a target directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SRC=$(realpath ${1}) | |
DST=$(realpath ${2}) | |
find ${SRC} -type f -exec sh -c 'ln -s "{}" "'${DST}'/$(basename "{}")"' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment