Chinaunix首页 | 论坛 | 博客
  • 博客访问: 429964
  • 博文数量: 184
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 594
  • 用 户 组: 普通用户
  • 注册时间: 2013-12-17 16:24
个人简介

我是一只小小鸟

文章分类

全部博文(184)

文章存档

2016年(1)

2015年(55)

2014年(127)

2013年(1)

分类: LINUX

2014-04-29 14:33:23

将当前目录下的所有目录打包成tar.gz文件,命令:

[root@localhost home]# ls

1  1.c  2  2.c  3  3.c  4

[root@localhost home]# tar cvf test.tar.gz *.c

[root@localhost home]# ls

1.c 2.c 3.c test.tar.gz

[root@localhost home]# rm -rf 1.c 2.c 3.c 

[root@localhost home]# ls

test.tar.gz

[root@localhost home]# tar xvf test.tar.gz 

1.c

2.c

3.c

[root@localhost home]# ls

c  2.c  3.c  test.tar.gz

[root@test7 shell]# ls

fgets.c     func.sh  str_cpoy.c error.txt  output.txt  python compare fun2.java   hello.c  parameter stderr.txt   string.c   convert.py  func4.java  printf.sh   root.sh    stdout.txt  swap.c 

[root@test7 shell]# tar cvf source_code.tar.gz /home/shell/*c   /打包文件的目录;

[root@test7 shell]# ls

fgets.c     func.sh source_code.tar.gz  str_cpoy.c error.txt  output.txt  python compare fun2.java   hello.c  parameter stderr.txt   string.c   convert.py  func4.java  printf.sh   root.sh    stdout.txt  swap.c

解压filename.tar.gz文件命令:tar xvf filename.tar.gztar -xvf filename.tar.gz(解压到当前文件夹)



解压RPM包

RPM包括是使用cpio格式打包的,因此可以先转成cpio然后解压,如下所示:

rpm2cpio xxx.rpm | cpio -div

阅读(1228) | 评论(0) | 转发(0) |
0

上一篇:iso文件的使用

下一篇:python中help信息

给主人留下些什么吧!~~