Windows 上的 Unix 风格的工具?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1414383/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 06:42:36  来源:igfitidea点击:

Unix-style tools on Windows?

windowsunix

提问by Chris Simmons

At work (a mostly Unix development shop), I've had an OS X box for the past 1.5 years and a Linux box before that. Due to various circumstances, I'll be getting a Windows XP laptop in the next few weeks. I'm of mixed feelings about this - it's good in that, as a manager, I'm used to running a Windows install (via Parallels) for Excel, Outlook, etc., but it's bad in that I'll miss all of the Unix tools available on OS X.

在工作中(主要是 Unix 开发商店),过去 1.5 年我有一个 OS X 机器,在那之前有一个 Linux 机器。由于各种情况,我将在接下来的几周内获得一台 Windows XP 笔记本电脑。我对此感到很复杂 - 作为一名经理,我习惯于为 Excel、Outlook 等运行 Windows 安装(通过 Parallels),但这很糟糕,因为我会错过所有OS X 上可用的 Unix 工具。

So, my question to you (community wiki perhaps?) is: What sort of tools would a Unix developer find handy when using a Windows machine? I'd like to be able to do some development on the machine (Perl, mostly), and also easily remote to other (Unix) machines. Here's what I've been recommended so far:

所以,我要问你的问题(也许是社区 wiki?)是:Unix 开发人员在使用 Windows 机器时会发现什么类型的工具很方便?我希望能够在机器上进行一些开发(主要是 Perl),并且还可以轻松地远程连接到其他(Unix)机器。到目前为止,我推荐的内容如下:

Editor: gvim

编辑:gvim

SSH: PuTTY

SSH:腻子

回答by Alex Martelli

You want cygwin-- and secondarily, for when you absolutely have to work in a CMD.EXE console, unxutils.

您需要cygwin- 其次,当您绝对必须在 CMD.EXE 控制台中工作时,unxutils

回答by Yawar

Try MinGW, the Minimalist GNU for Windows. Here's a list of GNU tools they offer: http://sourceforge.net/projects/mingw/files/

试试 MinGW,Windows 的极简主义 GNU。这是他们提供的 GNU 工具列表:http: //sourceforge.net/projects/mingw/files/

This includes things like bash, sed, awk, grep, cut, and other familiar GNU tools. Perl is in there as well. I find it a good light-weight alternative to Cygwin.

这包括 bash、sed、awk、grep、cut 和其他熟悉的 GNU 工具。Perl 也在那里。我发现它是 Cygwin 的一个很好的轻量级替代品。

回答by Stefan Steiger

On windows, you will miss the great GNU/Linux/Unix tools like sed, awk, wget, grep, tr, locate, file, dd, diff,

在 Windows 上,你会错过伟大的 GNU/Linux/Unix 工具,如 sed、awk、wget、grep、tr、locate、file、dd、diff、

I wouldn't recommend cygwin though, I prefer native tools.

不过我不推荐 cygwin,我更喜欢本机工具。

You can find native ports of the GNU tools at http://gnuwin32.sourceforge.net/

您可以在http://gnuwin32.sourceforge.net/找到 GNU 工具的本地端口

Then you need a decent syntax highlighter, notepad is just an antique. Geany is best on Linux, and there is a windows port: http://www.geany.org/Download/Releases

那么你需要一个像样的语法荧光笔,记事本只是一个古董。Geany 在 Linux 上是最好的,并且有一个 windows 端口:http: //www.geany.org/Download/Releases

There is also a windows port of The Gimp, free and opensource, offers the same and more functions as adobe photoshop (but with another interface). It's modest bit more difficult to use, though. http://gimp-win.sourceforge.net/

还有一个免费开源的 The Gimp 的 windows 端口,提供与 adobe photoshop 相同和更多的功能(但有另一个界面)。不过,使用起来稍微有点困难。 http://gimp-win.sourceforge.net/

For a C/C++/Lisp/Ada compiler and makefiles, you need MinGW, Minimalist GNU for Windows, together with msys (a linux like console). Unlike cygwin, mingw and msys compile native win applications.

对于 C/C++/Lisp/Ada 编译器和 makefile,您需要 MinGW、Minimalist GNU for Windows 以及 msys(类似于 linux 的控制台)。与 cygwin 不同,mingw 和 msys 编译本机 win 应用程序。

Windows doesn't have Perl installed by default. You can download a free Perl interpreter from http://www.activestate.com/

默认情况下,Windows 没有安装 Perl。您可以从http://www.activestate.com/下载免费的 Perl 解释器

Finally, you could install CoLinux, with which you can run Linux apps. on Windows. CoLinux is hard to install, AFAIK, and you can mess up your computer if you don't know what you do.

最后,您可以安装 CoLinux,通过它您可以运行 Linux 应用程序。在 Windows 上。CoLinux 很难安装,AFAIK,如果您不知道自己在做什么,可能会弄乱您的计算机。

If you have Vista Ultimate or XP, you can install SUA/WSU, Windows Services for Unix. On Vista, it's in the OS Components tab under add/remove software in the control panel On XP, you must download 300 MB from Microsoft.

如果您有 Vista Ultimate 或 XP,您可以安装 SUA/WSU、Unix 的 Windows 服务。在 Vista 上,它位于控制面板中添加/删除软件下的操作系统组件选项卡中。在 XP 上,您必须从 Microsoft 下载 300 MB。

回答by Stu Thompson

Cygwin

赛格温

Linux-like environment for Windows making it possible to port software running on POSIX systems (such as Linux, BSD, and Unix systems) to Windows.

类似于 Linux 的 Windows 环境,可以将在 POSIX 系统(例如 Linux、BSD 和 Unix 系统)上运行的软件移植到 Windows。

回答by Chris Sobolewski

Is your laptop good enough to run a VM? That will certainly get you the best of both worlds.

您的笔记本电脑是否足以运行虚拟机?这肯定会让你两全其美。

回答by Kajukenbo

Instead of Cygwin or putty consider MobaXterm and maybe a few plug-ins. No install needed and it is free; based on Cygwin code. You just start a single executable file.

考虑 MobaXterm 和一些插件,而不是 Cygwin 或 putty。无需安装,免费;基于 Cygwin 代码。您只需启动一个可执行文件。

It includes vim, sed, awk, wget, grep, openssh-server, ssh, scp, bash, rsync, X server, {lots more} and you can add things like perl, emacs (why?! :D ) screen, curl or python as plug-ins just by downloading them (versions from the mobaxterm site) into the same directory. It takes moments to be up & running.

它包括 vim、sed、awk、wget、grep、openssh-server、ssh、scp、bash、rsync、X 服务器、{更多},您可以添加诸如 perl、emacs(为什么?!:D)屏幕、curl 之类的东西或者 python 作为插件,只需将它们(来自 mobaxterm 站点的版本)下载到同一目录中即可。启动和运行需要一些时间。

Be sure to set up a persistent home directory and restart mobaxterm so you can keep your ssh keys, bash profile, etc. (ssh-keygen is included...)

请务必设置一个持久的主目录并重新启动 mobaxterm,以便您可以保留您的 ssh 密钥、bash 配置文件等(包括 ssh-keygen...)

You do not need to license it but you get a few extra goodies if you do. The first thing I do on windows box is to download mobaxterm. I do not use putty anymore unless I have no choice.

你不需要许可它,但如果你这样做,你会得到一些额外的好处。我在 windows box 上做的第一件事就是下载 mobaxterm。除非别无选择,否则我不再使用腻子。

main site: http://mobaxterm.mobatek.net/

主站:http: //mobaxterm.mobatek.net/

some plugins: http://mobaxterm.mobatek.net/plugins.html

一些插件:http: //mobaxterm.mobatek.net/plugins.html

Just download the 'portable edition' zip file, extract it into a directory, open the executable {NOT the customizer...}, ignore any warnings, set a persistent home [Settings > Configuration > Misc Tab], close the application, restart the application, and thenconfigure to your taste. This way all of your settings will be saved. Now you can also make another directory to save logs to and turn on logging.

只需下载“便携版”zip 文件,将其解压缩到一个目录中,打开可执行文件 {NOT the Customizer...},忽略任何警告,设置一个持久主页 [Settings > Configuration > Misc Tab],关闭应用程序,重新启动应用程序,然后根据您的喜好进行配置。这样,您的所有设置都将被保存。现在您还可以创建另一个目录来保存日志并打开日志记录。

I like leaving 'Paste using right-click' "OFF" (unchecked) because it automatically pastes with a middle-button click anyway, like many terminals. BTW: Highlighting text adds it to your buffer/clipboard automatically.

我喜欢将“使用右键单击粘贴”保留为“关闭”(未选中),因为它无论如何都会自动粘贴中间按钮,就像许多终端一样。顺便说一句:突出显示文本会自动将其添加到您的缓冲区/剪贴板。

TIP: try "cd /drives/c/foo/bar" or the like and then search & parse your windows log files with grep, sed & awk ...

提示:尝试“cd /drives/c/foo/bar”或类似命令,然后使用 grep、sed 和 awk 搜索和解析您的 Windows 日志文件...

DISCLAIMER: I do not work for mobatek or develop mobaxterm but I am a licensed user.

免责声明:我不为 mobatek 工作或开发 mobaxterm,但我是许可用户。

回答by pavium

Cygwingives you Unix command-line tools in a Windows environment.

Cygwin为您提供了 Windows 环境中的 Unix 命令行工具。

回答by Marcus

Well, best thing for me is Mobaxterm http://mobaxterm.mobatek.net/features.htmlThis Cygwin distribution has no installation at all as is one single binary only.

嗯,对我来说最好的是 Mobaxterm http://mobaxterm.mobatek.net/features.html这个 Cygwin 发行版根本没有安装,因为只有一个二进制文件。

回答by Floam

I know I'm late to the party here, however, another great option is Git Bash.

我知道我在这里参加聚会迟到了,但是,另一个不错的选择是 Git Bash。

回答by user2284570

It depends on what you wants:

这取决于你想要什么:

Cygwin and it's fork Mingw add Compatibility layerdlls on top of Win32, while SUA/INTERIX run on top of the NTwith it's own subsystemand PE type of executables beneficing many of the things traditionally implemented as *nix syscalls (like fork()) which are available in Native NT but not on WIN32.
So application have a some kind of better support, you can see it here.

Cygwin 和它的 fork Mingw在 Win32之上添加了兼容层dll,而 SUA/INTERIX 在NT之上运行,它有自己的子系统和 PE 类型的可执行文件,有利于许多传统上实现为 *nix 系统调用的东西(如 fork())在 Native NT 中可用,但在 WIN32 上不可用。
所以应用程序有某种更好的支持,你可以在这里看到。

Otherwise cygwin is fully supported by red hat which means a lot of binary packages are available while on SUA, the first thing you'll probably need is to find a way to compile a recent toolchain with the outdated installed one.

否则 red hat 完全支持 cygwin,这意味着在 SUA 上有很多二进制包可用,您可能需要的第一件事是找到一种方法来编译最新的工具链,并安装过时的工具链。