Linux——打包压缩文件

来源:互联网 发布:中国新声音网络直播 编辑:程序博客网 时间:2024/06/05 06:30


生成安装包

打包压缩文件

tar -jpcv -f /tmp/me.tar.bz2 /tmp/me

together archive - filter (through bzip2) preserve permission create verbosely -file

 

安装文件

解压缩文件

tar -jxv -f /tmp/me.tar.bz2 -C /tmp


together archive - filter(through bzip2) eXtract verbosely -file     -direCtory


[root@localhost me]# tar -jpcv -f /tmp/me.tar.bz2 /tmp/me
tar: Removing leading `/' from member names
/tmp/me/
/tmp/me/you/
[root@localhost me]# tar -jtv -f /tmp/me.tar.bz2 |grep 'you'
drwxr-xr-x root/root         0 2013-10-03 10:16 tmp/me/you/
[root@localhost me]# tar -jxv -f /tmp/me.tar.bz2 tmp/me/you -C /tmp
tmp/me/you/