Created
July 30, 2017 12:05
-
-
Save alexwilson/255be9e9f4fab79246a397a4ff283bca to your computer and use it in GitHub Desktop.
reverse-symlink.sh
This file contains 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
#!/bin/bash | |
# | |
# Replaces an entire directory of symlinked files with their originals. | |
# | |
find -L $1 -xtype l -exec bash -c 'cp --remove-destination "$(readlink -f "{}")" "{}"' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment