tar 压缩、查看压缩文件内容,解压单个文件,文件夹

4520阅读 0评论2014-03-20 dzminglong
分类:LINUX

     查看压缩包内的内容
tar  tvf  Package_name.tar
压缩

点击(此处)折叠或打开

  1. [root@localhost ~]# cd /opt/
  2. [root@localhost opt]# mkdir 1 2
  3. [root@localhost opt]# touch 1.txt
  4. [root@localhost opt]# ls
  5. 1 1.txt 2
  6. [root@localhost opt]# tar jcf tmp.bz2 1 1.txt 2


 
查看压缩包内的内容

点击(此处)折叠或打开

  1. [root@localhost opt]# tar -tf tmp.bz2
  2. 1/
  3. 1.txt
  4. 2/

解压单个文件

点击(此处)折叠或打开

  1. tar jxvf tmp.bz2 1.txt
解压单个文件夹、多个文件夹

点击(此处)折叠或打开

  1. [root@localhost opt]# tar jxvf tmp.bz2 1 2
    1/
    2/




上一篇:php-5.3.27编译安装出的一个问题
下一篇: Mantis出现1502问题