Last active
December 24, 2015 04:19
-
-
Save MartinBrugnara/6742814 to your computer and use it in GitHub Desktop.
Remove file from symlinks (soft 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
# Note remove only the first occurrence | |
# TODO: let xargs remove all occurence | |
# $1 should be a valid ls selector | |
function rml(){ | |
ls -l $1 | grep -- '->' | sed -e's/.*-> //' | xargs -I % rm "%" -v | |
rm $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment