Answer by murlakatamenka for How can I find broken symlinks
For zsh users: rm -v **/*(-@) from zsh user guide (search for broken symlinks)
View ArticleAnswer by trinth for How can I find broken symlinks
Simple no-brainer answer, which is a variation on OP's version. Sometimes, you just want something easy to type or remember: find . | xargs file | grep -i "broken symbolic link"
View ArticleAnswer by Iskren for How can I find broken symlinks
I use this for my case and it works quite well, as I know the directory to look for broken symlinks: find -L $path -maxdepth 1 -type l and my folder does include a link to /usr/share but it doesn't...
View ArticleAnswer by conradkdotcom for How can I find broken symlinks
This will print out the names of broken symlinks in the current directory. for l in $(find . -type l); do cd $(dirname $l); if [ ! -e "$(readlink $(basename $l))" ]; then echo $l; fi; cd - >...
View ArticleAnswer by Alex for How can I find broken symlinks
find -L . -type l |xargs symlinks will give you info whether the link exists or not on a per foundfile basis.
View ArticleAnswer by andy for How can I find broken symlinks
If you need a different behavior whether the link is broken or cyclic you can also use %Y with find: $ touch a $ ln -s a b # link to existing target $ ln -s c d # link to non-existing target $ ln -s e...
View ArticleAnswer by pooryorick for How can I find broken symlinks
As rozcietrzewiacz has already commented, find -L can have unexpected consequence of expanding the search into symlinked directories, so isn't the optimal approach. What no one has mentioned yet is...
View ArticleAnswer by rozcietrzewiacz for How can I find broken symlinks
I'd strongly suggest not to use find -L for the task (see below for explanation). Here are some other ways to do this: If you want to use a "pure find" method, it should rather look like this: find ....
View ArticleAnswer by Sam Morris for How can I find broken symlinks
The symlinks command from http://www.ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz can be used to identify symlinks with a variety of characteristics. For instance: $ rm a $ ln -s a b $ symlinks...
View ArticleAnswer by kwarrick for How can I find broken symlinks
I believe adding the -L flag to your command will allow you do get rid of the grep: $ find -L . -type l http://www.commandlinefu.com/commands/view/8260/find-broken-symlinks from the man: -L Cause the...
View ArticleHow can I find broken symlinks
Is there a way to find all symbolic links that don't point anywere? find ./ -type l will give me all symbolic links, but makes no distinction between links that go somewhere and links that don't. I'm...
View ArticleAnswer by ArturZ for How can I find broken symlinks
find . -xtype l will skip broken links pointing to files in inaccessible directories. You can just search for links to inaccessible files:find . -type l ! -readableThis works correctly for cyclic...
View ArticleAnswer by liz for How can I find broken symlinks
I tookfind ./ -type l -exec file {} \; | that.awkand piped it into an Awk script, that way you can do whatever.#!/bin/awk -f#...
View ArticleAnswer by Nikita Zlobin for How can I find broken symlinks
Most comprehensive (imho) command to find broken symlinks without crossing partition bounds. Note, that symlink arguments must be containing directories, not symlinks themselves.find . -xdev -type d \|...
View Article