将 tar/gzip 添加到 windows 命令行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1551338/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
add tar/gzip to windows command line
提问by sunwukung
As the title says - anyone know of a method to add tar/gzip to the command line in Windows? I've installed Cygwin - but don't know if I have to add something to the PATH env variable to get tar as a cmd option
正如标题所说 - 有人知道在 Windows 中将 tar/gzip 添加到命令行的方法吗?我已经安装了 Cygwin - 但不知道是否必须向 PATH 环境变量添加一些东西才能将 tar 作为 cmd 选项
采纳答案by Greg Hewgill
回答by sunwukung
The method I've used to solve this is to install Cygwin then place the path to the bin directory in the PATH variable.
我用来解决这个问题的方法是安装 Cygwin,然后将 bin 目录的路径放在 PATH 变量中。
回答by VonC
9 years later (2019), a more modern option is to uncompress the latest Git for Windows(like PortableGit-2.17.0-64-bit.7z.exe
).
It comes with 250+ linux command compiled for Windows, including tar and gzip.
No Cygwin needed.
9 年后(2019 年),更现代的选择是解压缩最新的适用于 Windows 的 Git(如PortableGit-2.17.0-64-bit.7z.exe
)。
它带有为 Windows 编译的 250 多个 linux 命令,包括 tar 和 gzip。
不需要 Cygwin。
But an even more recent option is the Command Line in Windows 10 version 1803: it includes a native tar
and curl
, right from your regular CMD
.
(not gzip
though). See announcement.
但是,一个更近的选项是命令行在Windows 10版本1803:它包括自然tar
和curl
直接从你的常规CMD
。
(gzip
虽然不是)。见公告。
C:\Users\vonc>C:\Windows\System32\tar.exe --version
bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f-ipp
Nothing to install!
什么都不要安装!
回答by Unknown Name
You can install archiver instead of adding command in Windows cmd.exe, There only 10 step to install and create .tar.gz file: 1. Open: https://www.win-rar.com/download.htmlor https://www.7-zip.org/download.html2. Download Winrar Installer. 3. Open Winrar Installer. 4. Click "Agree" on Agreement. 5. Install Winrar. 6. Wait until Winrar fully installed in your computer. 7. Open file you want to compress with .gz 8. Right click the file. 9. Click "Add to Archive", and 10. Done. But, if you still want to add command in Windows cmd.exe you can use that Cygwin. Tutorial link: https://www.youtube.com/watch?v=Rb8qtbXGA6I
您可以安装归档程序而不是在 Windows cmd.exe 中添加命令,安装和创建 .tar.gz 文件只需 10 步: 1. 打开:https: //www.win-rar.com/download.html或https: //www.7-zip.org/download.html2. 下载 Winrar 安装程序。3. 打开 Winrar 安装程序。4. 在协议上点击“同意”。5.安装Winrar。6. 等待 Winrar 完全安装在您的计算机中。7. 使用 .gz 打开要压缩的文件 8. 右键单击该文件。9. 单击“添加到存档”,然后 10. 完成。但是,如果您仍想在 Windows cmd.exe 中添加命令,则可以使用该 Cygwin。教程链接:https: //www.youtube.com/watch?v=Rb8qtbXGA6I