一步以编程方式提取 tar.gz(在带有 7-Zip 的 Windows 上) [英] Programmatically extract tar.gz in a single step (on Windows with 7-Zip)

查看:19
本文介绍了一步以编程方式提取 tar.gz(在带有 7-Zip 的 Windows 上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:我希望能够在一个步骤中提取 tar.gz 文件.这使我的问题几乎与此相同:tar-gz 的堆栈溢出问题.

Problem: I would like to be able to extract tar.gz files in a single step. This makes my question almost identical to this one: Stack Overflow question for tar-gz.

我的问题几乎相同,但不相同,因为我想在 bat 文件或 Ruby 中使用 7-Zip 命令行(或类似的东西)在 Windows 上执行此操作/Perl/Python 脚本.

My question is almost the same, but not the same, because I would like to do this on windows using 7-Zip command-line (or something similar) inside a bat file or Ruby/Perl/Python script.

问题:事实证明,这项看似简单的任务比第一次出现时要复杂得多.有没有人已经有一个脚本可以做到这一点?

Question: This seemingly simple task is proving to be more involved than the first appearance would make it out to be. Does anyone have a script that does this already?

推荐答案

7z e example.tar.gz  && 7z x example.tar

使用 && 在一个步骤中组合两个命令.使用 7-Zip 便携版(您只需要 7z.exe 和 7z.dll).

Use && to combine two commands in one step. Use the 7-Zip portable (you will need 7z.exe and 7z.dll only).

这篇关于一步以编程方式提取 tar.gz(在带有 7-Zip 的 Windows 上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆