查找Linux下的空目錄技巧
代碼很土,但也很簡單。
if [ -z "$1" ]; then
echo Usage: $0 \<Target directory\>
exit 1
fi
echo -e Null directory list:
for i in $(find $1 -type d -print)
do
TMP=$(ls $i)
if [ "$TMP" = "\." ]; then
continue
elif [ -z "$TMP" ]; then
echo $i
fi
done