TweetFollow Us on Twitter

Mac in the Shell: Where to Begin

Volume Number: 26
Issue Number: 02
Column Tag: Mac in the Shell

Mac in the Shell: Where to Begin

The path to learning begins with you

by Edward Marczak

Introduction

The Mac in the Shell column has covered a lot of ground in its five year run. Its initial mission was to introduce OS X Administrators to the shell (typically using Terminal.app). There's a whole different, wonderful, powerful world hiding behind the GUI. Well, working in a shell is a somewhat nebulous, expansive area. I've also covered some shell-like topics, such as using Vim, Apache configuration, scripting languages like Python and more. It's time now, to revisit the roots of all this.

Now, I don't plan on covering very basic shell information. I've already done that, and it's all online. There are several factors leading me to this path. First, I've had some letters from readers asking, "hey, can you cover some shell scripting?" Second, I've had people say to me on several occasions, "you're really good at this, you're a natural." Finally, I had a conversation recently with someone looking to move her career forward a bit. She knows what to tackle, but not exactly how to get there. She started looking at programming classes, but without a real purpose. I find that most people don't retain much - or the right things - when they are taught *what* can be accomplished without being able to tie it into anything real-world.

So, to answer those things: first: sure! I can cover shell scripting! Second, no, I'm not a natural. If anyone could see the behind the scenes practice, obsession and dedication to the craft, it might not look so easy or natural. Third, I get the sense there are many people in my friend's position: having an idea and knowing a direction, but not knowing where to get started. Welcome to the next few columns of Mac in the Shell. Let's go.

The Focus

Just for the record, this is still the Mac in the Shell column. Meaning, I'll be focusing on how to learn about shell tools. While some of the information I'm presenting could be used generically, I'm really not going to be talking about how to better learn Adobe Photoshop or other package. There is certainly an uptick in the need for people that have shell and scripting skills, and that's what I'll be guiding people through getting some traction on. Now let's get started.

Resources

Luckily for you, you're not the first to travel this path. There are plenty of resources out there for you to learn from. The sticking point usually is your learning style. While some prefer just to dive in, other like reading at length first and others learn best in a classroom environment. This is critical: make sure you match how you learn best with the method of learning. Unfortunately, different methods can have wildly different costs in both time and money.

I'm not formally an educator, so, I won't try to detail everything about a learning style. However, I feel most people recognize the style that suits them best pretty well. Here are some styles I've identified and will focus on here:

  • Self-starter, self-directed: Just popping open Terminal.app and having at it matches this style. The help that's built-in to the tool or system is enough to work by.

  • Reader: the reader, well, reads! Magazines and books make up the bulk of this learning style. This is essentially the self-starter style, but provides self-paced learning and requires dedication and focus.

  • Classroom led: Some people perform best in a classroom (or classroom-like) situation. The ability to ask questions of a teacher as you're going through the material and try out examples right in class are hallmarks of this style.

  • One-on-one: This is really just an extension of the classroom-lead style, with two important distinctions: first, it's one-on-one, with no additional students to distract you or take up time with the leader (or possibly, mentor in this case). Secondly, this style will typically come to pass in a work situation where there is some real project or end-goal, so the "labs" will be decidedly more real world.

You may have noticed yourself in one of those descriptions. That's great! You may have also noticed yourself in several of those descriptions. That's great, too! There's no reason these styles can't be combined. Like most people, though, you likely more strongly identify with one style over the others.

Self-Starter

If you're a self-starter, well, you're most likely not even reading this, but fiddling about with code. Even self-starters, though, look for help from time-to-time. Unlike people in some of the other styles, the self-starter will likely look for help, not in books, but from their peers: advice from mailing lists, web searches, Twitter posts and simple messages directly to people that may have the answer they seek.

If you feel that you're in the self-starter style, but are just getting started-perhaps you're an experienced user, just new to Mac OS X-here are some places for quick answers:

- man pages: This should already be a familiar resource, and they're no different under OS X. Apple has thankfully provided man pages as resources for nearly every OS X-specific shell command.

- Command help: most commands will yield help by providing no parameters, or, via an '-h' switch.

- Mailing lists: Apple runs a bevy of lists that are of great use. You can find the full list at lists.apple.com, but I'll highlight some I find useful:

- cocoa-dev - Just about all technical Mac people should be at least moderately familiar with the Cocoa framework, as it influences everything on the system. http://lists.apple.com/mailman/listinfo/cocoa-dev

- Darwin-userlevel - A Unix-y jaunt through Mac OS X and the underpinnings in the shell. http://lists.apple.com/mailman/listinfo/darwin-userlevel

These lists may be a bit over your head if you're just starting out. Howver, don't let that discourage your signing up. Every bit of reinforcement helps and before you know it, you'll have greater understanding and will be helping out others.

The Reader

Well, you're here, aren't you? Really, though, the "reader" I have in mind is looking at longer, in-depth resources (which is why I'm leaving out blog posts and most web articles, as they tend to cover one, focused topic, rather than leading a reader through an arc of learning). Reading a single tome about, say, bash scripting, is different than reading several web-articles about bash-scripting.

So, what resources are there for The Reader? Plenty! Well-written books with a staff behind them haven't gone away. I'm referring to a publisher with an editorial staff that can find authors, copy and tech edit, properly index a book and more.

It may seem that I'm being a little tough on blogs or web articles, but that's not exactly true. You just need to understand the source. For every wonderful article I've seen, I've also read error-filled articles with poor advice. It's not that this can't happen in the traditional publishing world, but it's less likely as there are jobs on the line. (Really: the tech editor of a book should be pressed when there are these types of errors in a tech book).

Where to go?

O'Reilly http://www.oreilly.com: I have to start with the stalwart of tech material. O'Reilly has long brought a subject's best along to write. Their huge catalog has something for everyone. Specifically, for bash scripting, there are the following:

- Learning the bash Shell, 3rd Edition. While you can find most of this online in one place or another, it's much nicer to have it in one consolidated tome. This book brings you from beginner to quite advanced. http://oreilly.com/catalog/9780596009656/

- The bash Cookbook: Once you know what you're doing, doing it is sometimes a chore when you know that someone has already tackled the problem you're trying to solve. Additionally, it's often instructive just to see how others have come up with a solution. http://oreilly.com/catalog/9780596526788/

I'll also mention that as far as I've found, the entire catalog is available electronically, both in the subscription-based Safari service (http://safari.oreilly.com) and in the for-purchase, you-own-it kind. Pretty soon, I'm going to need a twelve-step program for the e-books here.

Pragmatic Programmers. Somewhat new to the scene, Pragmatic Programmers has quickly built up an impressive, accessible catalog.

- TextMate - when you're working in the shell, you'll ultimately need to edit text files. You want a text editor that's working with you and making your job easier. Textmate is one of those editors. There are certainly other editors available on the Mac (for instance, vim/MacVim is my utility of choice), but TextMate has a huge community and availability of resources available to it. If TextMate is your preferred editor, or you haven't chosen one yet, give TextMate: Power Editing for the Mac a look. http://pragprog.com/titles/textmate/textmate

Peachpit Press. Home to the official Apple guides to certification, there are a wide-variety of titles. The advanced guides to configuration, deployment and server administration contain the shell equivalents to their GUI counterparts, encouraging scripting for the admin. Even if you're not planning on getting Apple certification or taking any of the exams, worthwhile reading includes:

- Mac OS X Unix 101 Byte-Sized Projects: Gentle introductions and uses for Unix commands under Mac OS X. http://www.peachpit.com/store/product.aspx?isbn=0321374118

Peepcode. Now, this isn't actually "reading," but "watching"-they're screencasts. I'll include it here as it is reading-like, more than it's any of the other styles (it's a one-way medium, like a book). Personally, I'm generally not a fan of screencasts, but I know plenty of people that are, and that like learning this way. Also, I'm singling out Peepcode as they make some of the only screencasts that I'll watch. They're factual, exceptionally well-produced and, most importantly, to the point. Nothing like a meandering screen-or-pod-cast to allow you to lose focus. Peepcode produces no-cruft screencasts.

Check out these titles:

- Meet the Command Line - https://peepcode.com/products/meet-the-command-line

- Advanced Command Line - https://peepcode.com/products/advanced-command-line

- Ruby 1.9, Part 1 - https://peepcode.com/products/ruby19-i

Apress. Apress has been making a strong push into the Mac market. With titles specific to iPhone and Mac development, Mac system administration and general scripting, you can find titles that suit your needs.

- Pro Bash Programming: Scripting the GNU/Linux Shell: a bash scripting guide for those that are past the basics. http://apress.com/book/view/1430219971

Classroom Led

If you've determined that the classroom-led style is best for you, you're in luck - there are many resources out there. I'll drop these into three categories: Apple-certified, non-Apple-certified and "informal."

Apple-certified training centers jump through some hoops to call themselves as such. First, people are charged with creating course and training material. This material is focus-group tested with subject matter experts. The books become the Peachpit Press materials mentioned above. There is also classroom material created at this time that is only available when you take a course. Once this material is locked in, the course creators train "Master Trainers." The Master Trainers in turn train the trainers that offer the certified courses.

Non-Apple-Certified training centers are just that: training centers that have no formal affiliation with Apple. Most training centers are reputable and can prepare you for an Apple exam just as well as an Apple-certified trainer. Even better: a non-Apple-certified trainer isn't constricted in the material they teach. While an Apple-certified trainer must teach a certain curriculum, a non-Apple-certified trainer is free to tell you that the book says one thing, but that in practice, things work a little differently. (Also remember the converse here: every Apple-certified training center is free to offer non-Apple courses as well, such as Linux and Windows training).

Informal classes are those given at user-group meetings, Macworld conferences and so on. While they may not seem "informal," especially since you may be paying, these setups are temporary, and the person teaching in one session may not be the same next time. I tend to speak at Macworld, and while I don't treat it as "informal" - I carefully prepare all material, typically have handouts, etc. - I will concede that it is an informal class: you'll see me teach, and then won't see me again for a year. Cocoa-heads user group meetings also fit this mold: meeting one a month is regular, but the person presenting a subject at one meeting will likely be different the next. All in all, though, you have an expert at your disposal for a period of time and get to ask questions.

Apple-certified training centers are easily found-just visit http://train.apple.com. You can search for locations close to you.

Non-Apple-certified training centers won't necessarily have a central location to be found - unless you consider a search engine that central location. Running a Google search on "NY shell scripting class" brought back appropriate results.

The informal classes will just pop up on your radar if you're looking for them. Keep an eye out for local user groups, Cocoaheads meetings (http://cocoaheads.org) and events like Macworld where you'll find these gatherings.

One-on-One, or, Mentoring

Since this is a much more rare and privileged situation, there isn't much in the way of a central place to find someone who will mentor you. The mentor relationship usually goes beyond simple hire-me-and-I'll-teach. There is, however, something incumbent on you if you desire this type of learning: seek it out. This scenario isn't going to come to you.

You can certainly ask someone you respect if they can take you under their wing. This is easiest in a work setting, but doesn't always have to be. Depending on the topic, sometimes a phone or e-mail relationship will suffice. Some companies have a more formal mentoring program. Again, you should be seeking that out. It's amazing what can happen when you ask.

Some resources may exist in local/regional user groups or special interest groups. Many regions have Macintosh Users Groups ("MUGs"). For the developer types, there are locally run CocoaHeads meetings around the globe. Apple runs the Apple Consultants Network ("ACN"), which, despite being aimed towards independent consultants, is appropriate to a broader group. Most regions have locally run meetings that feature vendors and members that give presentations on technical topics.

Summary

This column is the result of several things with a common thread: someone asked me to teach them or how to get started. I'd like to continue to hear from people about topics that they would like to see covered. None of this is magic or innate; it takes some amount of work. Most importantly, whatever your learning style, there are resources available to you. Stay aware, and you'll find learning material nearly everywhere you look.

Media of the month: Twin Peaks on CBS (http://www.cbs.com/video/?showname=classics/twin_peaks&showtype=classics). It's a bit of a cult classic, but I've been into cult classics lately; this fits right in. Plus, it's available for free, which is a double win.

Next month, I'll focus on problem solving: integrating Drop Box into your bash experience. Until then, keep your eyes open!


Ed Marczak is the Executive Editor of MacTech Magazine. He has written the Mac in the Shell column since 2004.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »

Price Scanner via MacPrices.net

New today at Apple: Series 9 Watches availabl...
Apple is now offering Certified Refurbished Apple Watch Series 9 models on their online store for up to $80 off MSRP, starting at $339. Each Watch includes Apple’s standard one-year warranty, a new... Read more
The latest Apple iPhone deals from wireless c...
We’ve updated our iPhone Price Tracker with the latest carrier deals on Apple’s iPhone 15 family of smartphones as well as previous models including the iPhone 14, 13, 12, 11, and SE. Use our price... Read more
Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more
Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more

Jobs Board

DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
IT Systems Engineer ( *Apple* Platforms) - S...
IT Systems Engineer ( Apple Platforms) at SpaceX Hawthorne, CA SpaceX was founded under the belief that a future where humanity is out exploring the stars is Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.