#!/bin/bash

# 递归文件夹,查询zip文件

function readZipFile ()
{
  for file in `ls $1`
 do
# -d表示这个是 文件夹
 if [ -d $1"/"$file ]
then
# 是文件夹就递归
readZipFile $1"/"$file
else
# 判断是否是zip文件
if echo $1"/"$file | grep -q -E '.zip'
then
# 输出文件的地址
echo $1"/"$file
fi
fi
done
}
path="/home/"
readZipFile $path
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐