压缩命令
# 7z压缩命令
Owner: -QVQ-
7z [<command>](notion://www.notion.so/commands/index.htm) [[<switch>](notion://www.notion.so/switches/index.htm)...] <base_archive_name> [<arguments>...]
<arguments> ::= [<switch>](notion://www.notion.so/switches/index.htm) | <wildcard> | <filename> | [@listfile]
[<switch>](notion://www.notion.so/switches/index.htm)::= -{switch_name}
支持通配符
*.txt | means all files with an extension of ".txt" |
---|---|
?a* | means all files with a second character of "a" |
1 | means all names that contains character "1" |
..* | means all names that contain two at least "." characters |
a
7z a file1 file2
将file2 压缩生成file17z a archive2.zip .\path\*
讲path文件夹下所有文件压缩到archive2.zip
x
7z x *.zip [-o文件路径 [*.cpp]] [-r]
与e的唯一区别是*.zip需要全路径
e
7z e *.zip [-o文件路径 [*.cpp]] [-r]
提取当前路径下所有.zip文件,[]内表示可选,-o表示提取到哪个路径,*.cpp表示限定只提取.cpp后缀的文件,-r表递归提取
powershell下批量解压缩到当前路径
start "D:\7-ZIP\7z.exe" "e $pwd\*.zip -o$pwd -r"
//删除.zip文件
rm *.zip
上次更新: 2025/02/21, 14:57:10