澄清概念与总体思路
场景一 用 Linux 解压工具处理竞品资料包
| 格式 | 解压命令示例 | 备注 |
|---|---|---|
| .tar.gz / .tgz | tar -xzvf file.tar.gz -C /path |
同时解包并解压 |
| .tar.bz2 | tar -xjvf file.tar.bz2 |
bzip2 压缩 |
| .tar.xz | tar -xJvf file.tar.xz |
xz 压缩 |
| .zip | unzip file.zip -d /path |
需安装 unzip |
| .rar | unrar x file.rar |
需安装 unrar |
| .7z | 7z x file.7z -o/path |
需安装 p7zip;-o 指定输出目录,注意 -o 与路径不能有空格 |
for f in *.tar.gz; do tar -xzvf "$f" -C /data/competitor; donetar -tzvf file.tar.gz、unzip -l file.zip-C /target/path;7z 使用 -o/pathsudo apt-get install unrar p7zip-full(Debian/Ubuntu 系)。场景二 用 Linux 命令行做竞品数据采集与文本“提取”
curl -s -L "https://example.com/competitor" -o page.htmlgrep -oP 'class="title"[^>]+href="\K[^"]+' page.html | sed 's/&/\&/g'?start=24&num=24),用 Shell 循环拼接 URL 批量抓取。grep -i -A3 -B3 "error" app.logawk '{print $9}' access.log | sort | uniq -c | sort -nrawk '/May 10 04:00:00/,/May 10 04:30:00/' system.logjq 'select(.response_code >= 400) | {time: .timestamp, url: .request.url}' api.logawk '{print $9}' access.log | sort | uniq -c | sort -nr | gnuplot -p -e 'plot "-" using 2:1 with boxes'场景三 将“解压”和“提取”串联成完整竞品分析流水线
data/competitorA/2026-01-01/)。sort | uniq -c | sort -nr)。