我有一个ZIP文件目录(在Windows机器上创建的)。我可以手动解压缩他们使用unzip文件名,但我怎么能解压缩所有的ZIP文件在当前文件夹通过shell?
使用Ubuntu Linux服务器。
我有一个ZIP文件目录(在Windows机器上创建的)。我可以手动解压缩他们使用unzip文件名,但我怎么能解压缩所有的ZIP文件在当前文件夹通过shell?
使用Ubuntu Linux服务器。
当前回答
for i in `ls *.zip`; do unzip $i; done
其他回答
在任何POSIX shell中,这将为每个zip文件解压缩到不同的目录:
for file in *.zip
do
directory="${file%.zip}"
unzip "$file" -d "$directory"
done
用这个:
for file in `ls *.Zip`; do
unzip ${file} -d ${unzip_dir_loc}
done
只需输入一些引号来转义通配符:
unzip "*.zip"
Use
sudo apt-get install unzip
unzip file.zip -d path_to_destination_folder
在Linux中解压缩一个文件夹
要解压缩目录中的所有文件,只需在终端中键入以下命令:
unzip '*.zip'