
11

tar:从压缩包中解压出指定文件
source link: https://blogread.cn/it/article/4136?f=hot1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

tar:从压缩包中解压出指定文件
浏览:4980次 出处信息
如果你下载了一个压缩包,虽然本身不是很大,但是解压后会很大;可是你并不会去看里面所有的文件,而是只看具体的某一个或几个文件而已,这时你的磁盘空间有很有限,于是你很想只解压指定的文件,于是下面命令就可以用上了。
1. tar -ztf xx.tar.gz | grep file_you_want_to_get
看看你要解压的文件的具体路径,假设为 path/to/file
2. tar -zxf xx.tar.gz path/to/file
然后,你要的file就放到了path/to 目录下了
>tar -ztf glibc-2.9.tar.gz | grep ldconfig.c
glibc-2.9/elf/ldconfig.c
>tar -zxf glibc-2.9.tar.gz glibc-2.9/elf/ldconfig.c
建议继续学习:
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
扫一扫订阅我的微信号:IT技术博客大学习
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK