Linux 解压缩与管道命令

gzip:(不能是目录,只能压缩单个文件)
压缩
gzip hellobak.c
解压
gunzip hellobak.c.gz
unzip --- 解压zip类型

tar 打包命令:(tar [-cxtzjvf] 文件与目录)
例如
tar –cvf hello.tar hello.c hellobak.c -------- 只打包不压缩(把hello.c hellobak.c 打包成 hello.tar)
tar –xvf hello.tar --------------------------- 解包
tar –cvzf hello.tar.gz hello.c hellobak.c -- 打包并压缩

管道:(grep '搜索的字符串' filename)
ls / | grep root

--------例:
1、解压
gunzip apache-tomcat-6.0.20.tar.gz
2、解包
tar -xvf apache-tomcat-6.0.20.tar
3、解压缩
tar -czvf xxx.tar.gz dir... file...[tgz]
tar -xzvf xxx.tar.gz
tar -cjvf xxx.tar.bz2 dir... file...
tar -xjvf xxx.tar.gz

猜你喜欢

转载自hospop.iteye.com/blog/2046182