使用windows系统,但是想使用linux的一些命令,WSL是个不错的选择,但是觉得它包也大,安装上整个系统也变得慢了(可能错觉)。下面有相应的几个工具,对比一下Cygwin, MSYS2

Cygwin is:
a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.
a DLL (cygwin1.dll) which provides substantial POSIX API functionality.

MSYS2:
MSYS2 (Minimal SYStem 2) is an independent rewrite of MSYS, a (command-line) shell for development usage, and based on modern Cygwin (POSIX compatibility layer) and MinGW-w64 (from “MinGW-builds”), with the aim of better interoperability with native Windows software.

MinGW 的全称是:Minimalist GNU on Windows 。它实际上是将经典的开源 C语言 编译器 GCC 移植到了 Windows 平台下,并且包含了 Win32API ,因此可以将源代码编译为可在 Windows 中运行的可执行程序。而且还可以使用一些 Windows 不具备的,Linux平台下的开发工具。一句话来概括:MinGW 就是 GCC 的 Windows 版本 。


MinGW-w64 与 MinGW 的区别在于 MinGW 只能编译生成32位可执行程序,而 MinGW-w64 则可以编译生成 64位 或 32位 可执行程序。正因为如此,MinGW 现已被 MinGW-w64 所取代,且 MinGW 也早已停止了更新,内置的 GCC 停滞在了 4.8.1 版本,而 MinGW-w64 内置的 GCC 则保持更新


区别

1、从目标上说MinGW 是让Windows 用户可以用上GNU 工具,比如GCC。Cygwin 提供完整的类Unix 环境,Windows 用户不仅可以使用GNU 工具,理论上Linux 上的程序只要用Cygwin 重新编译,就可以在Windows 上运行。

2、从能力上说如果程序只用到C/C++ 标准库,可以用MinGW 或Cygwin 编译。如果程序还用到了POSIX API,则只能用Cygwin编译。

3、从依赖上说程序经MinGW 编译后可以直接在Windows 上面运行。 程序经Cygwin 编译后运行,需要依赖安装时附带的cygwin1.dll。

  1. Cygwin 适用于希望在其 Windows 操作系统上使用 UNIX 的人。 MSYS 适用于想要使用 GNU/UNIX 构建工具构建 Windows 程序的人。 GnuWin32 是单个 GNU 程序和库到 Windows 的端口。

配合使用

下载使用ConEmu,更好得使用各种终端。

相关链接:

https://www.zhihu.com/topic/19683170/hot