我有一堆zip文件,我想在Linux中解压到自己的目录中。 例如:
a1.zip a2.zip b1.zip b2.zip
将被解压缩到:
a1 a2 b1 b2
分别。 有没有简单的方法来做到这一点?
for x in *.zip; do unzip -d "$(basename "$x" .zip)" "$x"; done
不需要使用外部基本名称
for file in *zip do unzip -d "${file%.zip}" "$file" done