在 CentOS(或其他 Linux 系统)中,extract 本身不是标准命令,你大概率是想问 解压(tar / unzip 等)时如何排除某些文件。
下面按常见情况说明:
tar -xf archive.tar --exclude='file1' --exclude='dir/*'
示例:
tar -xvf test.tar.gz --exclude='log/*.log'
tar -xf archive.tar \
--exclude='a.txt' \
--exclude='cache/' \
--exclude='*.tmp'
unzip archive.zip -x "*.log" "temp/*"
示例:
unzip test.zip -x "*.txt" "docs/*"
7z x archive.7z -x!*.log -x!temp/*
tar -czf out.tar.gz --exclude='*.log' /data
❌ extract 不是 Linux 命令
✅ 实际使用的是:
tarunzip7zrpm2cpio(RPM 包)请贴出:
type extract
或
which extract
我可以帮你精确改。
如果你能说明:
我可以给你一条可直接用的命令。