Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- echo "Size before:"
- du -sh
- find -name jdiff | xargs rm -rf
- find -name "*sources*.jar" | xargs rm
- find -name "aws-java-sdk-bundle*" | xargs rm
- #Replace duplicate with symbolic links
- fdupes -r -1 . | sed -e 's/\(\w\) /\1|/g' -e 's/|$//' > files
- while read line; do
- IFS='|' read -a arr <<< "$line"
- orig=${arr[0]}
- for ((i = 1; i < ${#arr[@]}; i++)); do
- file="${arr[$i]}"
- ln -sf "$orig" "$file"
- done
- done < files
- echo "Size after:"
- du -sh
Add Comment
Please, Sign In to add comment