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.

發佈了88 篇原創文章 · 獲贊 9 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章