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

Fallout Shelter pulls in ten times its u...
When the Fallout TV series was announced I, like I assume many others, assumed it was going to be an utter pile of garbage. Well, as we now know that couldn't be further from the truth. It was a smash hit, and this success has of course given the... | Read more »
Recruit two powerful-sounding students t...
I am a fan of anime, and I hear about a lot that comes through, but one that escaped my attention until now is A Certain Scientific Railgun T, and that name is very enticing. If it's new to you too, then players of Blue Archive can get a hands-on... | Read more »
Top Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
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 »

Price Scanner via MacPrices.net

Verizon has Apple AirPods on sale this weeken...
Verizon has Apple AirPods on sale for up to 31% off MSRP on their online store this weekend. Their prices are the lowest price available for AirPods from any Apple retailer. Verizon service is not... Read more
Apple has 15-inch M2 MacBook Airs available s...
Apple has clearance, Certified Refurbished, 15″ M2 MacBook Airs available starting at $1019 and ranging up to $300 off original MSRP. These are the cheapest 15″ MacBook Airs for sale today at Apple.... Read more
May 2024 Apple Education discounts on MacBook...
If you’re a student, teacher, or staff member at any educational institution, you can use your .edu email address when ordering at Apple Education to take up to $300 off the purchase of a new MacBook... Read more
Clearance 16-inch M2 Pro MacBook Pros in stoc...
Apple has clearance 16″ M2 Pro MacBook Pros available in their Certified Refurbished store starting at $2049 and ranging up to $450 off original MSRP. Each model features a new outer case, shipping... Read more
Save $300 at Apple on 14-inch M3 MacBook Pros...
Apple has 14″ M3 MacBook Pros with 16GB of RAM, Certified Refurbished, available for $270-$300 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year warranty is... Read more
Apple continues to offer 14-inch M3 MacBook P...
Apple has 14″ M3 MacBook Pros, Certified Refurbished, available starting at only $1359 and ranging up to $270 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year... Read more
Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more

Jobs Board

Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL 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
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.