November 9, 2012

Living the Unix Life in Windows

Filed under: Main — admin @ 12:01 am

Recently, I’ve taken it upon myself to bone up on my Unix. I keep a Terminal window open on my Macintosh, and I’ve been plowing through the Propeller-Head books, discovering more about how Unix works, honing my shell scripting techniques, and discovering all sorts of wonderful and powerful things the World’s Best Computer Operating System can do.

I’ve you’ve read my blog posts for the past (Gads! Has it been?) five years, then you know I’m an old fogey when it comes to using computers. I enjoy the command prompt. Obviously Unix and I are headed toward a torrid love affair.

There is a command prompt (DOS or Terminal) window open on just aboute every computer that encircles me. It’s just that there are many, many handy things you can do at the command prompt that would take too much time to do in a graphical environment like Windows.

Take the recent mega-post I did on the robocopy command. Please!

While I’m enjoying reviewing and learning new Unix terminal commands, occasionally they do get in the way: Whenever I switch over to my writing computer I’m faced with a DOS prompt (the CMD window). Instead of typing DIR to list a directory, I type ls, which is the Unix command that does the same thing.

The problem with typing ls instead of DIR at the C:> prompt?

'ls' is not recognized as an internal or external command,
operable program or batch file.

You can learn a few things from this lesson. First, appreciate how much DOS was despised back in the day; the error message doesn’t explain much. Second, at least it’s a better error message than the original Bad command or filename. Third, obviously Microsoft doesn’t believe in the serial comma.

There is available a more powerful command line program called PowerShell. It features a lot of the common DOS commands, but also some hybrid Unix commands. It’s pretty spiffy. In fact, if it came out 15 years ago I’d be clamoring to write a book on it. Today? Meh.

The problem I’m having now is that the PowerShell would just Yet Another Thing to learn in Windows. So instead, I opted to download the Cygwin package,

Cygwin was originally developed by Cygnus Solutions, hence the “cyg” in the name. Today it’s distributed by the Red Hat Linux people. It’s basically a Unix shell that runs under Windows. It provides a Unix command prompt — the bash shell (if that means anything) — in which I can exercise my Unix muscles.

It’s a dream.

Well, a nerd’s dream, but it’s still a dream.

You can check out Cygwin at cygwin.com It’s free. It’s pretty cool — if you’re into that kind of thing.

4 Comments

  1. I don’t use Linux very much but I do use it just enough where I sometimes get confused trying to run commands in Windows, like ls or some other *nix command. Fun times trying to move between the two operating systems.

    Comment by linuxlove — November 9, 2012 @ 7:31 am

  2. It’s obvious that one inspired the other. I can still move between them, but dwelling on one for a specific length of time can lead to unbound woe when switch back to the other.

    Comment by admin — November 9, 2012 @ 7:41 am

  3. Powershell comes installed by default with newer versions of Windows. This is good because now the shell in Windows can match the capability of *nix. I havent used Powershell but Ive heard that a lot of commands are compatible with the *nix shell. So if you write any more windows books like PC for Dummies, you may have to invest time into becoming proficient in Powershell. I personally would prefer to use a real scripting language like Ruby for any hardcore scripting tasks. There are a few of books out on how to use Ruby for genera purpose scripting: “Everyday Scripting with Ruby”, “Building Awesome Commandline Applications with Ruby”, “Practical Systems Administration with Ruby”. Dan, I know youre proficient with Perl, I imagine you pull up a Perl prompt if you have anything complicated tasks to perform.

    Comment by BradC — November 9, 2012 @ 12:13 pm

  4. It’s been years since I’ve Perled. I could pick it up again, but do I have the time?

    Comment by admin — November 9, 2012 @ 3:40 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.


Powered by WordPress