./zips/
a.zip - contains bla.txt , cla.txt
b.zip - contains bla.txt, cla.txt
c.zip - contains somethingelse.txt, this.xls
d.zip - contains bla.txt
... - ...
/tmp/ 폴더에 출력해야 합니다.
a_bla.txt
a_cla.txt
b_bla.txt
b_cla.txt
c_somethingelse.txt
c_this.xls
Tried mkdir tmp
for f in *.zip; do unzip "$f" -d tmp && mv tmp/* "${f%.zip}.txt"; done
rmdir tmp
답변1
노력하다:
for zip in *.zip; do bsdtar -xvf "$zip" -C /tmp -"s/^/${zip%.zip}_/"; done