Ask LH: How Can I Make The Windows Command Prompt Better?

Dear Lifehacker, I'm familiar with the Unix command line on Linux and OS X, but I've recently switched to Windows and the Command Prompt (cmd.exe) feels, well, kind of crappy. How can I make it a bit more useful and user-friendly? Sincerely, Pissed at the Prompt

Dear Pissed,

The Windows Command Prompt certainly isn't the most friendly terminal around, and if you're coming from a UNIX background, it can feel like moving from a Ferrari to Fred Flintstone's car. Luckily, with a few tweaks, you can make the Command Prompt just as user-friendly as any other Terminal. Here's how to do it.

Install Cygwin

You've probably heard us mention Cygwin before, and we really can't recommend it enough. It takes the crappy Windows Command Prompt and turns it into the useful UNIX terminal Mac and Linux fans are used to. All the commands you remember from your UNIX days will work in Cygwin beautifully, and you can use UNIX-based scripts and programs (like our very own Gina Trapani's Todo.sh) just like you can on Linux or OS X. We've gone through a more detailed guide to Cygwin before, so I won't get too deep into it here. I'll just tell you that your number one job should be installing it, as it'll make your life so much better.

Install a Different Terminal Program

Cygwin isn't actually a separate program, as it might appear to be. Instead, its a shell that loads in the regular Command Prompt program. Thus it solves half the problem of the Command Prompt -- not having any of the same commands or syntax -- but it doesn't actually solve the other problems inherent to the program itself. If you want better text selection, better copy and paste, window transparency, and other useful features, you'll want a new Terminal program entirely.

I'm a big fan of Console myself, though many prefer previously mentioned Mintty. Both serve similar purposes: they make your terminal act a bit more like the Mac or Linux terminals you're used to, by bringing better copy and paste, text editor-like text selection, and more to your terminal. I prefer Console mainly because it supports tabs, where Mintty does not. However, if you don't require tabs in your terminal, you might want to give Mintty a shot.

If you're using Mintty, the best way to install it is through the Cygwin installer. Run the Cygwin installer again and check it off under "Shells" in the "Select Pacakges" screen. Then, you can access it from the Cygwin folder in your Start Menu.

Make Cygwin Your Default Shell (Console Only)

If you're using Console instead of Mintty, you've got one extra step before you can get on tweaking your terminal. By default, Console will start up the regular old Windows command line, which is not what we want. To change this, start up Console and go to Edit > Settings. Under "Shell", type C:\cygwin\Cygwin.bat. That will make Console use Cygwin as your default shell when you start it up, so you don't have to worry about starting it up manually each time.

Obviously, if you want the Windows command line, you can still use the original Command Prompt application. Alternatively, if you head to the "Tabs" section of Console's preferences, you can add a new tab under Tab Name, call it "Windows CMD" (or whatever you want), and set the shell to %windir%\system32\cmd.exe. You can also change the startup directory to your User folder (e.g. C:\Users\Whitson), since console will use its program folder by default. Now, when you open a new tab, you can choose to either open a Cygwin tab or a Windows Command Prompt tab, which is pretty convenient.

Tweak Your New Terminal's Settings

Lastly, you can go nuts configuring your new terminal to your liking. The first thing I did was head into Appearance (or "Looks" on Mintty) and get rid of the absurdly bolt fonts, since all it did was take up space. I also like to make my Terminal somewhat transparent, so I can see the window behind it, since the window behind it is often is a list of commands I need to run (and then I don't need to constantly switch between windows). You can even make it copy text as soon as you select it, which is under Console's behaviour tab and Mintty's Mouse tab. Dig around in the settings and see if there's anything else you want to change. There's a lot of handy stuff in there, and it'll make your life a heck of a lot easier when it comes time to do some command line work.

Lastly, be sure to check out our three part guide to Cygwin (you can read through part II here and part III here), as well as our guide to time-saving terminal shortcuts.

Cheers, Lifehacker

P.S. Got any of your own favourite tips for improving the Windows command line? Share them with us in the comments.


Comments

    Try powershell.

    Nice. I knew about Cygwin but learnt a few new things here, like the different amount of terminal programs for Windows.
    Should make the very occasional Windows sessions a lot less frustrating and painful now.

    It's a command prompt - if you're not a nerd you shouldn't be using it.

      Cygwin is a powerful tool that can help a large variety of users achieve what they want much faster. As is generally the nature with more powerful software it takes a higher skill level to use it. But the effort is very worthwhile.

    The only thing I don't like about cmd these days is that it only takes half a screen maximised and that fullscreen is gone. Apparently a design decision, great example of making a feature out of removing functonality. Thankfully it's not as useful nowadays and not as necessary as on *nix boxes which *STILL* have awful GUI.

    I'm also a big fan of puttycyg, an extension to PuTTY to let it also act as a local cygwin terminal. http://code.google.com/p/puttycyg/

    Give PowerShell a bash.

    It can do some pretty awesome stuff, powershell dot com has some good resources on the topic.

    As others have pointed out Powershell. Cygwin is more of a tool to port Unix apps to windows not really a console replacement.

    I am a fan of using the right tool for the job.
    If you are on a ubuntu machine use a bash console, on a windows box use powershell/cmd.

    This in my mind is similar to trying to run cmd.exe in wine on a linux box.

    PowerShell earns me my living, I love it. Cmd.exe is dated, and due for an upgrade. PowerShell is it. Cmd.exe is still (and likely always will be) the wrapper. Cygwin is _NOT_ an appropriate replacement for Cmd.exe.

Join the discussion!

Trending Stories Right Now