Thursday 25 October 2007

Welcome to Darwin!

I realised recently that I've neglected to publish a post about maybe the most important open source topic in OS X, Darwin. What's even more important is Darwin is part of the very lowest levels of OS X.
"Darwin includes the kernel, device drivers and driver support frameworks, a BSD personality layer, and various libraries and command-line utilities." This may not mean all that much to the regular user, who is used to using applications and lets the OS do its thing in the background, but there are some very powerful Darwin tools that you can get your hands on.

For most of us, we would access Darwin's features and programs through the Terminal application. This can, by default, be found in your applications folder, then in the Utilities sub folder. Once Terminal is opened you are now able to use the UNIX layer of OS X, which comes with many of the GNU tools which are used in the GNU operating system and many of the classic UNIX tools.

Some of my favourite tools are; the emacs text editor, ftp and the less command.
Emacs is a text editor originally built by Richard Stallman. It comes installed as default on every mac and you can access it simply by typing 'emacs' into your Terminal. Emacs is known for being highly customizable and is largely used by programmers. I use it for quickly editing a file, usually if I'm browsing my hard drive from the Terminal. If you type emacs then the file name you can quickly make some adjustments then press control-x then control-c to exit emacs. You can find out more about emacs here.
Next there's ftp. It amazed me when I used to go hunting around for the best open source ftp client when there was one already built into my mac, and a good one at that. Ok, I admit it's a bit strange to get used to coming from a GUI app as it's text based. But if you want to quickly retrieve a file from a remote server it's ideal. Simply type ftp then the address of the server into your Terminal, followed by the username, then the password and you're away. Type 'bye' to exit.
Finally there's the less command. This is great if you quickly want to view the contents of a text document. I use this a lot when I've named a lot of files incorrectly and I can't for the life of me remember which one I need. With less I can view the contents and find out. Type less followed by the file name to use this little puppy. Press 'q' to quit.

I have very much just scratched the surface here. There are many many more built in commands and software, even more available online. A good place to start would be to get to grips with some of the basic commands and view the man pages for these commands. This can be done by typing 'man' followed by the command. Another good place to find some great ported software for Darwin is Darwinports.