Browsing the archives for the pdf tag.

Unix for the Beginning Mage

Uncategorized

TUAW reports on a new UNIX for newbies eBook, available as a free PDF download. But it’s different from anything else I’ve seen - this one uses the euphemism of magic and spells for commands - something I thought might get quite tiresome after the first few pages but seems to really carry through due to the author’s skills of explanation and analogy. It contains one of the best explanations of relative and absolute paths I’ve ever seen:

Paths

Let’s discuss paths a bit more. Paths are just that: paths. In a forest, we walk along paths so we don’t get lost. In the Tower, we follow paths to different rooms. Filesystem paths are no different; they will lead you to different directories and files.

There are two types of paths to know about: absolute and relative. An absolute path is from the root to your destination. It’s like being at the front door of your house and walking to the kitchen. You are starting from the very beginning of your house. The same is true with a filesystem path — it starts from root ( / ). So any path you see that starts with a slash is an absolute path:

/mudroom/hallway/kitchen

A relative path is from your current location to your destination. For example, if you were in your hallway and wanted to go to your bedroom closet, that is a relative path. You’re not starting at your front door since you’re already in your house.

bedroom/closet

Relative paths do not start with a slash — which is a very easy way to tell the difference between absolute and relative paths!
Now, say you’re in your bedroom, but you wanted to leave and go to the kitchen.

../hallway/kitchen

Notice the dot dot ( .. ). That is a special thing in Unix that says “I am leaving my current room”.
Now that you understand paths better, let’s start walking around the Tower of Nix.

Here’s TUAW’s take on it.

Unix for the Beginning Mage:

Filed under: , ,

If you want to learn the OS X command line, but find the available books intimidating, bristle at the thought you should read anything for “dummies,” or just worry that you may by eaten by a grue while plumbing the depths of /dev/random, Unix for the Beginning Mage may be just what you’re looking for. The book, available as a free PDF download, takes a humorous approach to learning some basic features of the unix shell and environment. The premise is that you are a mage in some D&D inspired world learning to cast “spells” from the command line. The better your spellcasting becomes, the farther you advance through the “Tower of Nix.” Best of all, the example commands are all executed in the OS X Terminal.app, although it’s basic enough the examples should work without too much effort on other unices as well. So if you’ve been avoiding the command line, you’re officially out of excuses; drop by and read this very, very gentle introduction to Unix the Unix Mages have put together.

Just keep a Scroll of Kill -9 ready and watch out for that grue.

[thanks Scott!]

Read Permalink | Email this | Linking Blogs | Comments

(Via The Unofficial Apple Weblog (TUAW).)

No Comments


  • about

    meh.
  • Categories

  • Archives