Book HomeLearning UnixSearch this book

8.4. Using Unix on Non-Unix Systems

Once you get comfortable working quickly at the Unix command line, you may miss that power and flexibility when you use another system like Microsoft Windows. You can get programs--both commercial and freely available--that let you use a Unix-like shell prompt and Unix utilities (grep, sort, and so on) from within other operating systems. You'll also find that an increasing number of systems are built on top of the stable Unix or a Unix-like operating system. Two of the latest examples are Mac OS X on the Macintosh and a variety of machines with Linux embedded inside.

NOTE: Unix, Microsoft Windows, and the Macintosh all use different conventions for the way that they mark the end of a line of text. If you transfer text files between these systems, you'll probably need to convert them. (The command-line FTP client does this automatically if you set its ascii transfer mode.) And if you have an executable program file that runs on one system, it won't run on the others--unless it's written in Java or it's a script program from a language such as the shell or Perl.

8.4.1. Under Microsoft Windows

Cygwin, from http://www.cygwin.com, is a package of Unix-like software development utilities that runs under Microsoft Windows NT, 98, and 95 (and probably others, as Microsoft Windows evolves). Although it's aimed at software developers, it also has a lot of the standard Unix utilities. You can use Cygwin from its bash shell (a Unix-like shell) or from the standard Windows command shell.

The MKS Toolkit, from http://www.mks.com, is a commercial package of Unix-like utilities that runs under Microsoft Windows. MKS Toolkit has been on the market, and been updated constantly, since the time of MS-DOS in the 1980s.

With a little hunting, you'll find versions of other Unix programs for Windows systems. Three of these are the Pine email program, the Lynx browser, and vim, a version of the vi text editor.

8.4.2. Mac OS X

The latest version of the Macintosh operating system (as of this writing) is Mac OS X, a Unix-based system. The OS X window system, Aqua, interacts with the operating system much as the X Window System you've seen in this book. (In fact, you now can use X on the Mac!)

If you want to use a Unix-like terminal under OS X, you can open Terminal. It's a regular double-clickable application found in /Applications/Utilities. Navigate to it using the Finder, launch it, and you'll get a terminal window like the ones shown in this book.

Once you open Terminal, you can use standard Unix utilities on your Mac files, on files you create with those utilities, or on files you transfer over a network. File pathnames are separated by slashes (/), just as on Unix, but be sure to put quotes around Mac filenames that don't follow our file naming rules (see Section 4.1 in Chapter 4). Unlike Unix and Windows, some Macintosh files have two forks: the resource and data forks. If you copy a Mac file, watch out--the cp utility won't copy both forks! Instead, you'll need to install and run CpMac (from the Developer Tools CD that comes with OS X; then you can simply run /Developer/Tools/CpMac).



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.