dir=/usr/local/nginx/logs
 
for file in $dir/*; do
    echo $file
done

 

//结果
./test.sh 
/usr/local/nginx/logs/access1.log
/usr/local/nginx/logs/access.log
/usr/local/nginx/logs/error.log
/usr/local/nginx/logs/host.access.log
/usr/local/nginx/logs/logs
/usr/local/nginx/logs/nginx.pid

 

posted on 2020-09-29 20:32  架构艺术  阅读(306)  评论(0编辑  收藏  举报