设为首页
收藏本站
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
平台
Portal
论坛
BBS
文库
项目
群组
Group
我的博客
Space
搜索
搜索
热搜:
shell
linux
mysql
本版
用户
LinuxSir.cn,穿越时空的Linuxsir!
»
论坛
›
Linux 发行版讨论区 —— LinuxSir.cn
›
Debian Linux
›
tar命令错在哪里?
返回列表
查看:
943
|
回复:
5
tar命令错在哪里?
[复制链接]
luofeiyu
luofeiyu
当前离线
积分
31
IP卡
狗仔卡
发表于 2010-4-21 14:52:56
|
显示全部楼层
|
阅读模式
tar cvfz /home/pt/test/test.tar /home/pt/test/test.jpeg
tar: Removing leading `/' from member names
/home/pt/test/test.jpeg
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
显身卡
stesen
stesen
当前离线
积分
647
IP卡
狗仔卡
发表于 2010-4-21 15:09:41
|
显示全部楼层
/home/pt/test/test.jpeg 不能写绝对路径,tar是包括路径的
tar解包时也是根据相对路径的
cd到/,再tar cvfz /home/pt/test/test.tar home/pt/test/test.jpeg
回复
支持
反对
使用道具
举报
显身卡
fender010
fender010
当前离线
积分
2454
IP卡
狗仔卡
发表于 2010-4-21 15:27:30
|
显示全部楼层
backup:
tar -cvzf foo.tar /your/directory
restore:
cd /
tar -xvpf /path/to/foo.tar
回复
支持
反对
使用道具
举报
显身卡
poet
poet
当前离线
积分
1357
IP卡
狗仔卡
发表于 2010-4-21 15:56:14
|
显示全部楼层
一般在这种用法中, f 参数必须是最后一个参数,前面的参数顺序可以随意。
所以 zcf 是正确的, cfz 就不正确了。
回复
支持
反对
使用道具
举报
显身卡
luofeiyu
luofeiyu
当前离线
积分
31
IP卡
狗仔卡
楼主
|
发表于 2010-4-21 18:23:08
|
显示全部楼层
pt@pt-laptop:~$ cd /
pt@pt-laptop:/$ tar cvfz /home/pt/test/test.tar home/pt/test/test.jpeg
home/pt/test/test.jpeg
成功通过,我的源文件230k,压缩以后200k,可否设置参数让它再小点?
回复
支持
反对
使用道具
举报
显身卡
Celinda
Celinda
当前离线
积分
315
IP卡
狗仔卡
发表于 2010-4-21 18:34:32
|
显示全部楼层
tar cvfzP /home/pt/test/test.tar /home/pt/test/test.jpeg
gzip压缩率不高,换成bzip2试试?
回复
支持
反对
使用道具
举报
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
LinuxSir 论坛管理
内核与驱动开发
LFS(LinuxfromScratch)
shell进阶应用、shell编程
Gentoo Linux
Linux 输入开发与研究
Archlinux讨论区
Linux 基础讨论区(新手速成)
Slackware Linux
Copyright © 2002-2023
LinuxSir.cn
(http://www.linuxsir.cn/) 版权所有 All Rights Reserved.
Powered by
RedflagLinux!
技术支持:
中科红旗
|
京ICP备19024520号
快速回复
返回顶部
返回列表