遍历的是三级目录,可以自己添加递归
#!/bin/bash
cd /4a
for i in *; do
if [[ $i = flume_file || $i = lost+found ]]; then
continue 1
fi
cd $i
for j in *; do
if [[ -d $j ]]; then
cd $j
for z in *; do
echo $i/$j/$z >>/home/foura/file
done
cd ..
fi
done
cd /4a
done
遍历的是三级目录,可以自己添加递归
#!/bin/bash
cd /4a
for i in *; do
if [[ $i = flume_file || $i = lost+found ]]; then
continue 1
fi
cd $i
for j in *; do
if [[ -d $j ]]; then
cd $j
for z in *; do
echo $i/$j/$z >>/home/foura/file
done
cd ..
fi
done
cd /4a
done