刪除無效軟連線

LiuYinChina發表於2013-08-20

方法1.for f in $(find $1 -type l); do [ -e $f ] && rm -f $f; done

方法2.symlinks -d

symlinks:    scan/change symbolic links - v1.2 - by Mark Lord

Usage:       symlinks [-crsv] dirlist
Flags:         -c == change absolute/messy links to relative
                   -d == delete dangling links
                   -r == recurse into subdirs
                   -s == shorten lengthy links (only displayed if -c not specified)
                   -v == verbose (show all symlinks)

相關文章