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

Fresh From the Land Down Under – The Tou...
After a two week hiatus, we are back with another episode of The TouchArcade Show. Eli is fresh off his trip to Australia, which according to him is very similar to America but more upside down. Also kangaroos all over. Other topics this week... | Read more »
TouchArcade Game of the Week: ‘Dungeon T...
I’m a little conflicted on this week’s pick. Pretty much everyone knows the legend of Dungeon Raid, the match-3 RPG hybrid that took the world by storm way back in 2011. Everyone at the time was obsessed with it, but for whatever reason the... | Read more »
SwitchArcade Round-Up: Reviews Featuring...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for July 19th, 2024. In today’s article, we finish up the week with the unusual appearance of a review. I’ve spent my time with Hot Lap Racing, and I’m ready to give my verdict. After... | Read more »
Draknek Interview: Alan Hazelden on Thin...
Ever since I played my first release from Draknek & Friends years ago, I knew I wanted to sit down with Alan Hazelden and chat about the team, puzzle games, and much more. | Read more »
The Latest ‘Marvel Snap’ OTA Update Buff...
I don’t know about all of you, my fellow Marvel Snap (Free) players, but these days when I see a balance update I find myself clenching my… teeth and bracing for the impact to my decks. They’ve been pretty spicy of late, after all. How will the... | Read more »
‘Honkai Star Rail’ Version 2.4 “Finest D...
HoYoverse just announced the Honkai Star Rail (Free) version 2.4 “Finest Duel Under the Pristine Blue" update alongside a surprising collaboration. Honkai Star Rail 2.4 follows the 2.3 “Farewell, Penacony" update. Read about that here. | Read more »
‘Vampire Survivors+’ on Apple Arcade Wil...
Earlier this month, Apple revealed that poncle’s excellent Vampire Survivors+ () would be heading to Apple Arcade as a new App Store Great. I reached out to poncle to check in on the DLC for Vampire Survivors+ because only the first two DLCs were... | Read more »
Homerun Clash 2: Legends Derby opens for...
Since launching in 2018, Homerun Clash has performed admirably for HAEGIN, racking up 12 million players all eager to prove they could be the next baseball champions. Well, the title will soon be up for grabs again, as Homerun Clash 2: Legends... | Read more »
‘Neverness to Everness’ Is a Free To Pla...
Perfect World Games and Hotta Studio (Tower of Fantasy) announced a new free to play open world RPG in the form of Neverness to Everness a few days ago (via Gematsu). Neverness to Everness has an urban setting, and the two reveal trailers for it... | Read more »
Meditative Puzzler ‘Ouros’ Coming to iOS...
Ouros is a mediative puzzle game from developer Michael Kamm that launched on PC just a couple of months back, and today it has been revealed that the title is now heading to iOS and Android devices next month. Which is good news I say because this... | Read more »

Price Scanner via MacPrices.net

Amazon is still selling 16-inch MacBook Pros...
Prime Day in July is over, but Amazon is still selling 16-inch Apple MacBook Pros for $500-$600 off MSRP. Shipping is free. These are the lowest prices available this weekend for new 16″ Apple... Read more
Walmart continues to sell clearance 13-inch M...
Walmart continues to offer clearance, but new, Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBooks... Read more
Apple is offering steep discounts, up to $600...
Apple has standard-configuration 16″ M3 Max MacBook Pros available, Certified Refurbished, starting at $2969 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free,... Read more
Save up to $480 with these 14-inch M3 Pro/M3...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
Amazon has clearance 9th-generation WiFi iPad...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Apple is offering a $50 discount on 2nd-gener...
Apple has Certified Refurbished White and Midnight HomePods available for $249, Certified Refurbished. That’s $50 off MSRP and the lowest price currently available for a full-size Apple HomePod today... Read more
The latest MacBook Pro sale at Amazon: 16-inc...
Amazon is offering instant discounts on 16″ M3 Pro and 16″ M3 Max MacBook Pros ranging up to $400 off MSRP as part of their early July 4th sale. Shipping is free. These are the lowest prices... Read more
14-inch M3 Pro MacBook Pros with 36GB of RAM...
B&H Photo has 14″ M3 Pro MacBook Pros with 36GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 Pro MacBook Pro (... Read more
14-inch M3 MacBook Pros with 16GB of RAM on s...
B&H Photo has 14″ M3 MacBook Pros with 16GB of RAM and 512GB or 1TB SSDs in stock today and on sale for $150-$200 off Apple’s MSRP, each including free 1-2 day shipping: – 14″ M3 MacBook Pro (... Read more
Amazon is offering $170-$200 discounts on new...
Amazon is offering a $170-$200 discount on every configuration and color of Apple’s M3-powered 15″ MacBook Airs. Prices start at $1129 for models with 8GB of RAM and 256GB of storage: – 15″ M3... Read more

Jobs Board

*Apple* Systems Engineer - Chenega Corporati...
…LLC,** a **Chenega Professional Services** ' company, is looking for a ** Apple Systems Engineer** to support the Information Technology Operations and Maintenance Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
*Apple* / Mac Administrator - JAMF Pro - Ame...
Amentum is seeking an ** Apple / Mac Administrator - JAMF Pro** to provide support with the Apple Ecosystem to include hardware and software to join our team and 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.