shell删除失效软连接
#! /bin/bash
read path
if [ -z $path ]
then
echo "please enter scan path"
exit
fi
for file in $(find $path -type l)
do
if [ ! -e $file ]
then
echo "rm $file"
rm -f $file
fi
done
Mark it down to use.