文件与文件系统的压缩与打包
2016-06-22 11:04
393 查看
压缩文件的用途与技术
Linux系统常见的压缩命令
Compress
gzip,zcat
bzip2,bzcat
打包命令:tar
配置本地yum源
mount /dev/cdrom /mnt
/etc/yum.repos.d/aaa.repo
[aaa]
name=localyum
baseurl=file:///mnt
enabled=1
gpgcheck=0
yum list ncopmress
yum install ncompress -y
cd /opt
cp /etc/services .
compress -v services
uncompress
compress -c -v services > services.Z
rm -rf *
cp /etc/hosts .
gzip hosts
zcat hosts.gz
gzip -d hosts.gz 解压
gzip -c hosts > hosts.gz
bzip2 hosts
bzip2 -d hosts.bz2
bzip2 -c hosts > hosts.bz2
bzcat hosts.bz2
rm -rf hosts.bz2
zip hosts.zip hosts zip压缩
unzip hosts.zip
打包命令:tar
tar cvf hosts.tar hosts
源文件保留
tar cvf hosts.tar hosts --remove-files 不保留源文件
tar tvf hosts.tar 不解压查看归档内容
tar xvf hosts.tar
tar xvf hosts.tar -C aa/ 解压到指定目录
cp /etc/services /etc/passwd /etc/hosts .
tar cvf xx.tar * --remove-files
tar xvf xx.tar hosts
tar调用gzip or bzip2
tar zcvf xx.tar *
tar zxvf xx.tar.gz
rm -rf xx.tar.gz
tar jcvf xx.tar.bz2 * --remove-files
tar jxvf xx.tar.bz2 解压缩
tar jxvf xx.tar.bz2 hosts 只解压hosts
完整备份工具: dump
完全备份 0
增量备份
差异备份
dump -0
光盘写入工具:
dd if=/dev/zero of=file1 bs=1M count=1
创建3个文件
mkisofs -o xx.iso file1 file2 file3
cp /dev/cdrom xxx.iso
mount -o loop xxx.iso /mnt
其他常见的压缩与备份工具
dd if=/dev/sda3 of=test
拷贝file1,4到/opt
find -name 'file*' |cpio -o > xx.cpio -o打包
cpio -iu < xx.cipo 解压档 -i解包
Linux系统常见的压缩命令
Compress
gzip,zcat
bzip2,bzcat
打包命令:tar
配置本地yum源
mount /dev/cdrom /mnt
/etc/yum.repos.d/aaa.repo
[aaa]
name=localyum
baseurl=file:///mnt
enabled=1
gpgcheck=0
yum list ncopmress
yum install ncompress -y
cd /opt
cp /etc/services .
compress -v services
uncompress
compress -c -v services > services.Z
rm -rf *
cp /etc/hosts .
gzip hosts
zcat hosts.gz
gzip -d hosts.gz 解压
gzip -c hosts > hosts.gz
bzip2 hosts
bzip2 -d hosts.bz2
bzip2 -c hosts > hosts.bz2
bzcat hosts.bz2
rm -rf hosts.bz2
zip hosts.zip hosts zip压缩
unzip hosts.zip
打包命令:tar
tar cvf hosts.tar hosts
源文件保留
tar cvf hosts.tar hosts --remove-files 不保留源文件
tar tvf hosts.tar 不解压查看归档内容
tar xvf hosts.tar
tar xvf hosts.tar -C aa/ 解压到指定目录
cp /etc/services /etc/passwd /etc/hosts .
tar cvf xx.tar * --remove-files
tar xvf xx.tar hosts
tar调用gzip or bzip2
tar zcvf xx.tar *
tar zxvf xx.tar.gz
rm -rf xx.tar.gz
tar jcvf xx.tar.bz2 * --remove-files
tar jxvf xx.tar.bz2 解压缩
tar jxvf xx.tar.bz2 hosts 只解压hosts
完整备份工具: dump
完全备份 0
增量备份
差异备份
dump -0
光盘写入工具:
dd if=/dev/zero of=file1 bs=1M count=1
创建3个文件
mkisofs -o xx.iso file1 file2 file3
cp /dev/cdrom xxx.iso
mount -o loop xxx.iso /mnt
其他常见的压缩与备份工具
dd if=/dev/sda3 of=test
拷贝file1,4到/opt
find -name 'file*' |cpio -o > xx.cpio -o打包
cpio -iu < xx.cipo 解压档 -i解包
相关文章推荐
- 响应式三步曲
- Android 学习实例 Note笔记本
- 解决MySQL5.1安装时出现Cannot create windows service for mysql.error:0
- getWidth()和getMeasuredWidth()
- Android引导页面
- 玩转Eclipse开发工具(一)
- Motan:目录结构
- 003——filter粗粒度权限控制
- Spring中的线程池ThreadPoolTaskExecutor
- 音视频同步系列文章之------基于时间戳的同步点
- sizeof的用法及与strlen的比较
- 【分享】WeX5的正确打开方式(2)
- Android 自定义组合布局
- jquery $.type来实现类型判断
- 【剑指offer】包含min函数的栈
- Oracle查看会话剩余时间
- WPF获取键盘状态(如WPF组合键)
- 问题解决:引入com.sun.management.OperatingSystemMXBean 出错
- href="#"与href="javascript:void(0)"的区别
- 磁盘 I/O 性能监控指标和调优方法