65

I'm looking for an application that can act as an integrated Linux-like terminal for my Windows PC. For instance, I could roam around the file system, install applications like vi, etc. I would like this application to meet the following requirements,

  • Gratis
  • Uses Bash
  • Not an emulator (I can actually see my files on the C drive and interact with them)
  • Easy to install
  • Compatible with Windows 10
  • 13
    If you're willing to loose the bash-requirement you could also look at Powershell, which is scriptable and integrates to more windows services - en.wikipedia.org/wiki/Windows_PowerShell – johannes Sep 29 '15 at 11:57
  • 3
    ^ In that case, why not Python? It's also cross-platform, and really a fully capable general purpose programming language. – Sarge Borsch Sep 29 '15 at 18:37
  • 1
    There's always PuTTY. This would require a linux box on the network somewhere (e.g. raspberry pi, dedicated PC, virtual machine, EC2). This way you won't experience many of the pains of Cygwin. Added this as a comment because it's a rather loose interpretation of your criteria. However, for me, I prefer actual linux over Cygwin. – y3sh Sep 29 '15 at 19:45
  • 3
    Are you asking about a command shell or a terminal other than the Windows console? – JDługosz Oct 1 '15 at 7:32
  • ConsoleZ with native gnu tools is a good alternative – Petah Oct 2 '15 at 10:54
63

I've been using Cygwin for some time now and it seems to do the job. It was very easy to install and I could choose from many different packages to install like vim, wget, etc.

Cygwin

Get that Linux feeling - on Windows

Cygwin is a Unix-like environment and command-line interface for Microsoft Windows. Cygwin provides native integration of Windows-based applications, data, and other system resources with applications, software tools, and data of the Unix-like environment.

Cygwin terminals running on Windows 7

  • 5
    I've been using Cygwin for over a decade. It's my standard command line terminal (mintty) and I almost never have to use cmd.exe. – Jim Garrison Sep 29 '15 at 4:31
  • 5
    Why do you have a picture of Hamilton C Shell? – Steven Penny Sep 29 '15 at 17:29
  • 1
    Babun is very nice as an opinionated Cygwin configuration with a package manager and autoupdate. – Boggin Sep 30 '15 at 10:10
  • 1
    @kasperd I've never noticed a performance problem. I don't expect it to match native Linux performance, but there's never been a point where I was frustrated by bad performance. – Jim Garrison Oct 2 '15 at 16:40
  • 2
    @JimGarrison I think that can only mean you didn't use the slow features extensively, because the slowness was impossible not to notice for the shell scripts that I needed. Not that it was a source of frustration, since I could just ssh to a Linux server and run my scripts there. Cygwin was never a source of frustration to me - I would blame Windows instead and acknowledge that Windows with Cygwin was a better working environment than Windows without Cygwin. – kasperd Oct 2 '15 at 17:55
42

cmder

cmder

It combines ConEmu, a Windows console emulator augmented with bash-like capabilities by Clink and msysgit. Some notable features include:

  • Bash shell, through msysGit
  • GNU C Compiler & GNU Make
  • Perl
  • cURL
  • In-built SSH agent
  • Command auto-completion
  • Aliases (with the same syntax as bash)
  • Paste from keyboard with CTRLV

If you're looking for a package manager (e.g. apt-get or yum), Chocolatey is a possible Windows alternative. It doesn't contain all packages and some are occasionally outdated but it does have quite an impressive spread.

choco install googlechrome
  • 5
    +1 for saying Chocolatey has an impressive spread. :-) – Ian Goldby Oct 2 '15 at 7:33
  • 3
    +1 for simply mentionning Cmder, i love that piece of software. It is also portable, so you can have it on your usb stick and have it on the go, which is what i do to avoid the hideous cmd interface. – Yondaime008 Oct 2 '15 at 11:16
  • It's interesting that it uses Git Bash. I use it myself, but is it really the better approach vs Cygwin? There's no package manager. Chocolatey just seems to install Windows apps. – Aleksandr Dubinsky Oct 2 '15 at 16:00
  • 1
    In the context of the question (which asked for a bash shell) I think it's as good as Cygwin. Sometimes you don't need a full Linux system complete with package manager, just a bash shell for some quick and dirty work. – Huey Oct 2 '15 at 16:30
  • +1. cmder is probably as good as it gets. I will mention though it has a bunch of problems with redraw. (Eg if you have menus flickering in and out of existence in vim). – Lyndon White Aug 9 '16 at 1:11
20

Cygwin, already listed is a good solution.

However, there is another alternative: MSYS.

MSYS is much lighter weight than Cygwin, however it might not have everything you need. Obviously, you will have to evaluate that yourself. It definitely does meet all 5 of your bullet points. It's free, is has a Bash shell, you can interact with your current drives, its easy to install, and it works on Win10.

  • 7
    I would strongly suggest MSYS2 over ye olde MSYS. – rubenvb Oct 2 '15 at 8:41
18

Babun

A screenshot of me fooling around with nant through Babun. This is a solarized light theme

I'm surprised nobody mentioned Babun, "a windows shell you will love". It's a preconfigured Cygwin that "just works", generally quite awesome out of the box.

For a long time I used Git Bash (prettified with Console2), but I felt it quite lacking. I wanted more, but I was quite intimidated by Cygwin: I was afraid, perhaps unreasonably, of the bloat, and the difficulty of configuring the thing. I also wanted a reasonably good-looking terminal, and out-of-the-box cygwin just isn't very pretty. I'm afraid I'm going to sound like an advertisment, but Babun really just worked.

Now, onto the requirements:

  • it's free and open-source.
  • by default it uses zsh instead of Bash, but frankly, that's almost the same for the casual user. It can be reconfigured to use proper bash.
  • the actual Windows files can be perfectly interacted with, the drives are accessible under /cygdrive/, but are also aliased to their drive letters under root.
  • Installation is just running an install.bat.
  • Windows 10 compatibility is not perfect, but the fix looks straightforward enough.

It does have issues:

  • Symlinks are a bit crap, that's a Cygwin issue.
  • There's a permission-related error that caused me some grief.
  • Its footprint is not negligible (at around 800 MB on my machine with stuff I need for work), which makes non-Cygwin solutions (Git-bash or cmder) more suitable if disk space is an issue (yes, guys, disk space is sometimes still an issue).
  • oh-my-zsh's autocomplete can be slow. But you'll still love it.
  • there are some hiccups with the interaction with Windows files and applications in some edge cases, mostly for files with spaces in their names. These can be avoided easily enough, but it's still a bit of a pain. Calling windows executables with windowsy files as arguments requires the use of cygpath.
  • windows doesn't recognise Babun as an interactive shell, it thinks it's a pipe. This causes all sorts of issues with native node interactive programs. It's a mintty issue, that can be ameliorated

Generally, if you just want a good-looking shell with features, without spending any time on tweaking and configuring the thing, Babun is just perfect. There are annoying issues, but I like it :)

  • 1
    Could you please edit your answer and include how Babun matches each of the OP's requirements? For a guide on answers, please read our discussion on what makes an answer high quality. Thanks! – Izzy Sep 29 '15 at 20:17
  • +1, especially as it has a working zsh implementation out of the box – SztupY Sep 30 '15 at 15:52
  • The babun project is now officially dead. This should not be recommended anymore. – krishnakumar G Dec 1 '18 at 15:10
  • Yeah, unfortunately, Babun's been discontinued :(. It still kinda works though! – SáT May 16 at 13:23
16

What I use is a combination of Git Bash, which comes when you install Git, and ConEmu. Git Bash uses MinGW, and ConEmu provides the option to have multiple tabs and good colour schemes, the option to have a full screen terminal, and more.

  • 2
    ...and for those interested in software archaeology, Git Bash for Windows comes with perl v5.8.8 . It's hard to find a more out of date version of perl on windows. – tjd Sep 29 '15 at 13:09
  • @tjd perl --version reports v5.22.0 (latest stable) with my install of Git-2.5.2.2. – Boggin Sep 29 '15 at 15:45
  • @Boggin I'd given up on checking for an update to Git 1.9.5 on Windows. It's good to see they've finally delivered! – tjd Sep 29 '15 at 16:06
  • 3
    I have to say, I prefer Git Bash over Cygwin, just because if I really want a full Linux-like environment on my computer, that's when I boot into Linux. Cygwin's a great thing, but it's overkill if you just want a shell! – childofsoong Sep 29 '15 at 18:04
16

Windows 10, with the 2016 anniversary update, now provides a Bash Linux binary running on Windows itself. It can be accessed through any command prompt and can run UNIX-style commands (like ls) as it would with any other command. For more information about this, read the MSDN posts on the Windows Subsystem for Linux page.

Screenshot

  • 1
    I know, I'm really excited, can't wait:D – Tom Mar 31 '16 at 23:05
  • 1
    This looks really exciting. – Aiden Grossman Apr 1 '16 at 2:31
  • 2
    This should be the answer now, as it is actual Linux distros running on Windows 10 and extremely easy to set up. – Herohtar Oct 12 '17 at 21:31
  • 1
    still some missing features wpdev.uservoice.com/forums/… – Steven Penny Jan 1 '18 at 21:39
  • @StevenPenny thank you for the link and for mentioning the limitations. – Franck Dernoncourt Jan 1 '18 at 21:52
13

MSYS2 is a fork of Cygwin created with the intention of being an updated environment to support building with MinGW. (That is, it's meant to serve as a better maintained alternative to the ever more out of date MSYS. See here for some details.) It functions well as a bash shell with Linux tools on a Windows machine.

Requirements

  • Free
  • bash is the default shell
  • Installs on your machine and works on your local hard drive, not on an emulated system

    Note that you must either quote your paths (cd 'C:\') or use an alternative absolute specification (cd /c). I believe Cygwin, MSYS, and other related variants to be similar in this regard.

  • Uses a standard, executable Windows installer

  • I have not personally tested on Windows 10, but since it's a fork of Cygwin and closely tracks it, I am confident it's as compatible with Windows 10 as Cygwin is.

Other

In my mind, the biggest advantage of MSYS2 is the comparatively clean package management. Cygwin's and MSYS's package managers are, in my opinion, confusing and difficult to use. They're graphical and not very well integrated with the system itself. By contrast, MSYS2 ported Arch Linux's pacman, and all package management is done at the command line. There are a wealth of packages available and easily installable, from Python to Perl to vim to SVN to git to the MinGW compilers. There is a small hiccup with updating certain "core" packages: you have to restart your shell and run the update again, but this is vastly superior to having to launch some external graphical tool, in my opinion.

See the introduction and the comparison to Cygwin for MSYS2's own statement about the differences from Cygwin and what their goals were.

  • 2
    I agree! Additionally, ConEmu is a nice console emulator to use. I use zsh or fish as shells, but with MSYS2 in ConEmu, on a daily basis. – Josef Oct 1 '15 at 13:21
  • 1
    @Josef I find I'm generally happy with the console that it uses by default. It's definitely a lot better than the Command Prompt window. – jpmc26 Oct 1 '15 at 17:16
  • ConEmu has the advantage that it can also be used for native windows console applications and PuTTY/KiTTY, so I have all my consoles, local and remote, Windows and MSYS2 in one window. – Josef Oct 2 '15 at 7:08
5

As of 2015 and Python 3.4's release, there's now a reasonably complete user-interactive shell available at: http://xon.sh/

The demonstration video does not show pipes being used, but they ARE supported when in the default shell mode.

Xonsh ('conch') tries very hard to emulate bash, so things you've already gained muscle memory for, like

env | uniq | sort -r | grep PATH

or

my-web-server 2>&1 | my-log-sorter

will still work fine. You may need cygwin or msys around to have access to the GNU coreutils like grep and uniq. Windows has some of it's own builtins under unixlike names that can blow stuff up, so be careful with the order of your PATH variable.

The xonsh tutorial is quite lengthy and seems to cover a significant amount of the functionality someone would generally expect at an ash or bash prompt:

  • Compiles, Evaluates, & Executes!
  • Command History and Tab Completion
  • Help & Superhelp with ? & ??
  • Aliases & Customized Prompts
  • Executes Commands and/or *.xsh Scripts which can also be imported
  • Environment Variables including Lookup with ${}
  • Input/Output Redirection and Combining
  • Background Jobs & Job Control
  • Nesting Subprocesses, Pipes, and Coprocesses
  • Subprocess-mode when a command exists, Python-mode otherwise
  • Captured Subprocess with $(), Uncaptured Subprocess with $[], Python Evaluation with @()
  • Filename Globbing with * or Regular Expression Filename Globbing with Backticks
5

MobaXTerm

screenshot

  • Gratis: yes. It has Personal and Professional Edition. The professional edition mostly just adds a support contract and deployment tools AFAICT). You can use the personal edition at your workplace
  • Uses Bash: Yes. I am using MobaXTerm 8.6 and that is using Bash 4.1.17(0)-release. Newer versions of MobaXTerm may user new Bash
  • Not an emulator: Yes, it is not an emulator. It does start you up in side what looks like a Unix file structure (take a look as ls /), but if you navigate to /mnt/c your C drive it there.
  • Easy to install: yes. Comes as both a simple installer, and a portable exe
  • Compatible with Windows 10: Yes, and Vista and 7

Installing things like Vi it can do. It has its own apt-get which is MobApt, that is based on apt-cyg (version 0.59 for me) You just do normal debian style apt-get install vi etc.

I believe MobaXterm basically bundles Cygwin, but I prefer it, as last time I used Cygwin, it got all over my operating system, adding itself to verious menus. MobaXterm keeps it all contained.

MoboXTerm's main features are not really its local terminal though. Its probably most known for its a SSH client, with incorporated SFTP and X11. And a bunch of other things.s

  • This is a highly recommended program, particularly the X11 integration which makes it unique among other alternatives in the answers here. – krishnakumar G Nov 20 '18 at 19:38
  • Please note with this solution, you have to use their terminal emulator! :-( There is no separate bash.exe residing on the external normal file system you could start up in a terminal appilcation of your choice. (But I agree with @krishnakumarG, the X11 server it provides is excellent.) – halloleo Feb 22 at 1:53

protected by Community Sep 30 '15 at 16:33

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.