Managing Broken Symlinks
Posted: November 5th, 2009 | Author: Jerod | Filed under: Bash | Tags: configuration, find, symlinks | View CommentsI just added two new functions to my bashrc which make it super-simple to find & remove broken symbolic links on your system.
They’re simple wrappers around the ever-useful “find” utility:
function find_broken_symlinks() { find -x -L "${1-.}" -type l; } function rm_broken_symlinks() { find -x -L "${1-.}" -type l -exec rm {} +; }
You can call the functions with a specific path:
jerod@mbp:~$ find_broken_symlinks /usr/local/bin
Or you can call them sans argument to search your current working directory:
jerod@mbp:~$ find_broken_symlinks
Enjoy!
I've been looking for a similar to this post. Not only extensively but also detailly. We can learn a lot from the post. moncler jackets I recommend to you , ugg boots sale you can come communication in here. Let us grow up together.On the other hand ,I know some websites content is very well.you can go and see.Such asugg boots for sale