Shell 批量删除失效软链接

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.

你可能感兴趣的:(脚本)