简体   繁体   中英

Unix-style tools on Windows?

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.

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:

Editor: gvim

SSH: PuTTY

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

Try MinGW, the Minimalist GNU for Windows. Here's a list of GNU tools they offer: 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.

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

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

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

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

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/

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.

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

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.

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.

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.

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

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.

It includes the Busybox implementation of vi, sed, awk, wget, and grep, as well as 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. The tools in Busybox are not POSIX complete, but it is a pretty good start out-of-the-box.

It only takes a few minutes to be up & running.

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...)

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.

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

some plugins: 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 then configure 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.

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 ...

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

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

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

If the cygwin installation is too heavy-weight for you, and the GnuWin32 installation is too cumbersome (you have to install every tool individually), you can also try out GOW: https://github.com/bmatzelle/gow . The only downside is that the binaries are quite old..

恕我直言, cmder在 windows 中比在 cygwin 中使用 unix 命令更好。

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

GO for Cygwin.

First install the Cygwin, which gives you a nice unix like terminal. You have lots of additional packages you can install online.

For stuffs like perl and python go for Activestate "http://www.activestate.com/activeperl" http://www.activestate.com/activepython .

There is also "http://strawberryperl.com/" free, even for commercial usage.

Better yet, when you install cygwin select the packages openssh, perl and emacs. Then install ssh daemon using ssh-host-config -y and follow instructions . Now you can ssh to your Windows machine from your Linux box, happily use vi or emacs and develop in Perl, run your perl code, or any other command line Windows exe, or Java or Python, etc. as long as they are console apps (vs a graphical one).

It depends on what you wants:

Cygwin and it's fork Mingw add Compatibility layer dlls on top of Win32, while SUA/INTERIX run on top of the NT with it's own subsystem and 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 .

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.

I use the Git for Windows "contribute" version, aka msysgit: https://msysgit.github.io/#contribute

This single install includes: MSYS, MinGW, bash, GNU toolkit, gcc, g++, flex, bison, vim, gvim, ssh, git, svn, cvs, perl, tcl/tk, rxvt, etc. It's everything you would need to hack on git, and a good foundation for hacking on anything else.

msysgit takes up 1GB on the disk. (Windows Explorer will tell you it's 3GB, because it doesn't understand hard links.) It builds git from source, and there are a few large git repos.

MSYS+MinGW is lighter than Cygwin. It's better for porting, development, and for general use. It works both in the windows CMD prompt and in an rxvt terminal.

There is also MSYS2 , I haven't tried it yet but I hear it is more up to date than msys or msysgit. See also: How are msys, msys2, and msysgit related to each other?

You can also try 'Install Windows Subsystem for Linux' in Win10. Link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM