本帖最後由 MSI_R9_280_Gami 於 2026-4-27 16:15 編輯
commandline
.tar.gz > -z
.tar.bz2 > -j
.tar.xz > -J
brotli N/A
zstd N/A
lzma N/A
lzma篇
FreeBSD 15壓縮左個lzma包,一些linux variants derivants解壓縮lzma原來包喺xz入邊,tar -xJvf target。lzma其實即係microsoft windows的7z。某程度上lzma 7z xz係差不多?
壓縮係
tar --lzma -cvf target source_1 source_2 source_3
tar -I lzma -cvf target source_1 source_2 source_3
tar --use-compress-program=lzma -cvf target source_1 source_2 source_3
unrar篇
.rar係proprietary編碼解碼都係,但解碼器unrar好似限制少d,linux可用 non-free repository
mageia urpmi unrar
https://unix.stackexchange.com/questions/644491/how-can-i-extract-a-rar-file-on-debian
bsdtar -xvf target , which is included in package libarchive-tools
https://packages.debian.org/sid/libarchive-tools
mageia@localhost ~/Downloads> unrar 'resources.rar'
UNRAR 6.23 freeware Copyright (c) 1993-2023 Alexander Roshal
Usage: unrar <command> -<switch 1> -<switch N> <archive> <files...>
<@listfiles...> <path_to_extract/>
<Commands>
e Extract files without archived paths
l[t[a],b] List archive contents [technical[all], bare]
p Print file to stdout
t Test archive files
v[t[a],b] Verbosely list archive contents [technical[all],bare]
x Extract files with full path
<Switches>
- Stop switches scanning
@[+] Disable [enable] file lists
ad[1,2] Alternate destination path
ag[format] Generate archive name using the current date
ai Ignore file attributes
ap<path> Set path inside archive
c- Disable comments show
cfg- Disable read configuration
cl Convert names to lower case
cu Convert names to upper case
dh Open shared files
ep Exclude paths from names
ep3 Expand paths to full including the drive letter
ep4<path> Exclude the path prefix from names
f Freshen files
id[c,d,n,p,q] Display or disable messages
ierr Send all messages to stderr
inul Disable all messages
kb Keep broken extracted files
me[par] Set encryption parameters
n<file> Additionally filter included files
n@ Read additional filter masks from stdin
n@<list> Read additional filter masks from list file
o[+|-] Set the overwrite mode
ol[a] Process symbolic links as the link [absolute paths]
op<path> Set the output path for extracted files
or Rename files automatically
ow Save or restore file owner and group
p[password] Set password
r Recurse subdirectories
sc<chr>[obj] Specify the character set
si[name] Read data from standard input (stdin)
sl<size> Process files with size less than specified
sm<size> Process files with size more than specified
ta[mcao]<d> Process files modified after <d> YYYYMMDDHHMMSS date
tb[mcao]<d> Process files modified before <d> YYYYMMDDHHMMSS date
tn[mcao]<t> Process files newer than <t> time
to[mcao]<t> Process files older than <t> time
ts[m,c,a,p] Save or restore time (modification, creation, access, preserve)
u Update files
v List all volumes
ver[n] File version control
vp Pause before each volume
x<file> Exclude specified file
x@ Read file names to exclude from stdin
x@<list> Exclude files listed in specified list file
y Assume Yes on all queries
mageia@localhost ~/Downloads [7]> unrar e 'resources.rar'
UNRAR 6.23 freeware Copyright (c) 1993-2023 Alexander Roshal
Extracting from resources.rar
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
Extracting resources OK
All OK
GUI我推介peazip,有.deb .rpm,peazip portable有 based on C的qt、gtk+。both peazip & rar unrar are freewares,實測peazip可以成功解壓縮 .rar file
root@localhost ~# urpmi /home/mageia/Downloads/peazip-11.0.0.LINUX.Qt6-1.x86_64.rpm
SECURITY: The following package is _NOT_ signed (OK ((none))): /home/mageia/Downloads/peazip-11.0.0.LINUX.Qt6-1.x86_64.rpm
installing peazip-11.0.0.LINUX.Qt6-1.x86_64.rpm from /home/mageia/Downloads
Preparing... ##########################################################################################################################################################
1/1: peazip ##########################################################################################################################################################
我認為解壓縮比壓縮重要得多,网路上的資源根本不可能聯絡到原作者並要求提供指定格式,自由度不如自己壓縮。如果冇解壓既工具,下載完個包係冇用
使用peazip作前端 GUI frontend,zpaq ultimate extreme ultra compression ratio size唔係細好多。mageia冇zpaq lpaq *paq呢個套件,要用peazip
> ls -la *.rar *.zpaq
-rw-r--r-- 1 mageia mageia 328514053 Apr 24 00:42 'resources.rar'
-rw-r--r-- 1 mageia mageia 326743023 Apr 24 14:10 'resources.zpaq'
依稀記得十幾年前用peazip壓縮 *paq lpaq zpaq非常慢,現在用快左好多,懷疑係5代U E3-1285L v4有128MB L4 ondie cache,有好大得益。理論上9950X3D2有兩片CCD兩塊大緩存(快取)應該喺dram io密集既任務有優勢。去dram攞料要經uncore的memory controller即係北橋,再出去,再返返入黎,呢段距離用光速行係有延遲。ondie既cache會快好多,即係CL值,幾多個CPU circles dram cycles
呢個portable version aus peazip based on qt都幾搞笑,完全run唔到,要裝左 .rpm version先至run到,缺呢個 libQt6Pas.so libQt6Pas.so.6 libQt6Pas.so.6.2 喺 ./ folder內係soft links by ln -s target link_names,軟鏈結,軟指針指向 ./libQt6Pas.so.6.2.8,一路話缺,我見根本喺 ./ folder 入面存在they were existing,完全冇缺,整極唔得,原來係system folder缺,裝左 .rpm version補返就run到
mageia@localhost ~/Downloads> /home/mageia/Downloads/peazip_portable-11.0.0.LINUX.Qt6.x86_64/peazip
/home/mageia/Downloads/peazip_portable-11.0.0.LINUX.Qt6.x86_64/peazip: error while loading shared libraries: libQt6Pas.so.6: cannot open shared object file: No such file or directory
peazip portable gtk+ 版本質素高好多,冇呢個低能既bug
pezip有些特别的功能,包括但不限于 files comparing comparison,safely erase:「Zero delete」、「Secure delete」
zpaq in an archiver, it's primary and central purpose is to compress folders. You absolutely don't need to make a tar, try again.
zpaq 就是个压缩软件,它最主要、最核心的功能就是压缩文件夹。你完全不需要先打包成 tar,再试试。
zpaq 係一個歸檔工具,佢最主要嘅功能就係壓縮文件夾。你絕對唔需要整 tar 檔,再試吓啦。
Usage: zpaq command archive[.zpaq] files... -options...
zpaq add output.zpaq a b c d -m5
https://www.deploymentresearch.com/data-deduplication-reference-zpaq-benchmarking/
Data Deduplication Reference - ZPAQ Benchmarking - Deployment Research
0~5共5(6)層壓縮級數compression levels
-mtype[Blocksize[.pre[.arg][comp[.arg]]...]]
-method type[Blocksize[.pre[.arg][comp[.arg]]...]]
With "add", select a compression method. type may be 0, 1, 2, 3, 4, 5, "x", or "s". The optional Blocksize may be 0..11,
written with no space after the type, like "-m10" or "-method 511". The remaining arguments, separated by periods or commas
without spaces, are only allowed for types "x" or "s", for example "-mx4.3ci1".
If type is numeric, then higher numbers compress better but are slower. The default is "-m1". It is recommended for
backups. "-m2" compresses slower but decompresses just as fast as 1. It is recommended for archives to be compressed once
and decompressed many times, such as downloads. "-m0" stores with deduplication but no further compression.
我都幾肯定zpaq係記憶體密集的process,E3-1285L v4(peazip qt on mageia)同E5-2667 v2(peazip gtk+ / commandline zpaq on debian)大概要4.7分鐘。peazip壓出黎size恆定係326743023 326743021(懷疑係folder name改左所以略有變化),用commandline zpaq細500 bytes左右
-rw-rw-r-- 1 root root 326742516 Apr 24 19:43 a.zpaq
Fri Apr 24 07:15:19 PM HKT 2026
Fri Apr 24 07:20:12 PM HKT 2026
Fri Apr 24 07:38:47 PM HKT 2026
275.516 seconds (all OK)
Fri Apr 24 07:43:23 PM HKT 2026
debian安裝係#apt-get install libarchive-tools zpaq;apt-get install ./peazip_11.0.0.LINUX.GTK2-1_amd64.deb
remove #apt-get purge libarchive-tools zpaq peazip
#urpme unrar peazip
Commands:
a add Append files to archive if dates have changed.
x extract Extract most recent versions of files.
l list List or compare external files to archive by dates.
void@void /h/m/Downloads> zpaq x Music.zpaq |