#!/bin/bash dirpath=$1 function read_dir() { for file in `ls $1` do #echo "$1:"$1 if [ -d $1/$file ];then cd $1/$file read_dir $1"/"$file cd - else echo `pwd`/$file fi done } read_dir $dirpath
shell 递归遍历文件夹文件
原文:https://www.cnblogs.com/luckygxf/p/12312047.html