惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - 舒方小院

六一新玩具 some interesting words [原创] 算法题 Zero Sum的一种解法 [ZzDW] 关于Java对象序列化您不知道的5件事 [ZzZz && momo] linux 误删 恢复rm -rf [转载] Windows如何在cmd命令行中查看、修改、删除与添加、设置环境变量 [转载] Linux的capability深入分析 [攻略转载] 在飞机上睡觉的七大攻略 [转载] ftp的模式ACTIVE&PASSIVE [转载] QQ黑名单 [转载] Eclipse快捷键 10个最有用的快捷键 [转载] Mysql常用命令行大全 [转载] php java交互 php/java bridge [转载] MySQL命令行下执行.sql脚本详解 [转载] rpm 常用命令 [转载] 控制寄存器(CR0,CR1,CR2,CR3,CR4) [转载] 汇编中AREA和ENTRY理解 [转载] Centos下如何解包rpm文件 生命期是个不可大意的问题
Linux下压缩不包含路径信息的压缩包
舒方小院 · 2012-11-10 · via 博客园 - 舒方小院

适合于某些文件导出,但并不希望用户知道服务器上文件存放路径信息的需求。

【Tar篇 】

 在Linux下直接使用命令

tar jcvf file.tar.bz files 

压缩files目录时,如果当前files路径是在/home/www/files下,压缩后的file.tar.bz2会将包含files的绝对路径;

解决办法

tar jcvf file.tar.bz2 -C /home/www files

这样压缩后,就是可以得当一个相对路径的压缩包了,直接排除掉/home/www路径不压缩了。

Tar在Unix/Linux世界虽然流行,但在终端用户这边,zip格式还是绝对的主流,所以,有可能zip格式更有用。

【Zip篇】 

使用-j参数:不处理压缩文件中原有的目录路径 

 zip -qj file.zip /home/www/files