只是zip压缩了下,把对应的提取出来后,写到压缩文件里,再解压就可以了 //这里的14是bash脚本上定义skip的值,一般是14 /usr/bin/tail -n +14 test.sh >/tmp/1.gz gunzip /tmp/1.gz