Last active
March 22, 2017 15:10
-
-
Save approximatenumber/3c29f3392ff864693fcba76cf5fbe8e4 to your computer and use it in GitHub Desktop.
Move all symbolic links to hard links
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
path="." | |
for link in $(find "$path" -type l); do | |
ln -f $(readlink -f $link) $link | |
done | |
echo "Converted hard links from symlinks:" | |
find "$path" -type f -printf '%n %p\n' | awk '$1 > 1{$1="";print}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment