It is very rare that you want to dig a directory and create a ** directory path + file name list **, so leave it as a memo.
find * -type f
You can do it with. Thank you @ angel_p_57! !!
01_hokkaido
└ 001_sapporo
└xxxxx.jpg
└xxxxx.jpg
└xxxxx.jpg
└ 002_obihiro
└ 003_hakodate
⁝
02_aomori
└ 002_aomori
⁝
03_iwate
⁝
ls -1 | while read LINE
do
PREFECTURE=${LINE}
ls -1 "${PREFECTURE}" | while read LINE2
do
CITY="${LINE2}"
ls -1 "${PREFECTURE}"/"${LINE2}" | while read LINE3
do
FILE="${LINE3}"
echo "${PREFECTURE}"/"${CITY}"/"${FILE}"
done
done
done
You might be able to write it a little better with a recursive function. Please let me know if there is a metamorphosis one-liner person of Tsuyotsuyo engineer.
Recommended Posts