본문 바로가기
Computer/Linux

symbolic link 깨져 있는지 확인하기

by hexists 2018. 10. 1.

symbolic link가 깨져 있는 경우에는 다음과 같이 확인하면 됨



BROKEN_LINK=$(find /path/to -type l -xtype l | wc -l)


if [ $BROKEN_LINK -gt 0 ]; then


    echo -e "CHECK BROKEN_LINK:\t$/path/to"


    error


fi


ref : https://www.commandlinefu.com/commands/view/8260/find-broken-symlinks