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

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 »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »
Marvel Future Fight celebrates nine year...
Announced alongside an advertising image I can only assume was aimed squarely at myself with the prominent Deadpool and Odin featured on it, Netmarble has revealed their celebrations for the 9th anniversary of Marvel Future Fight. The Countdown... | Read more »
HoYoFair 2024 prepares to showcase over...
To say Genshin Impact took the world by storm when it was released would be an understatement. However, I think the most surprising part of the launch was just how much further it went than gaming. There have been concerts, art shows, massive... | Read more »
Explore some of BBCs' most iconic s...
Despite your personal opinion on the BBC at a managerial level, it is undeniable that it has overseen some fantastic British shows in the past, and now thanks to a partnership with Roblox, players will be able to interact with some of these... | Read more »

Price Scanner via MacPrices.net

You can save $300-$480 on a 14-inch M3 Pro/Ma...
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
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer 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 MacBook for sale by... Read more
B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more
14-inch M3 MacBook Pro with 16GB of RAM avail...
Apple has the 14″ M3 MacBook Pro with 16GB of RAM and 1TB of storage, Certified Refurbished, available for $300 off MSRP. Each MacBook Pro features a new outer case, shipping is free, and an Apple 1-... Read more
Apple M2 Mac minis on sale for up to $150 off...
Amazon has Apple’s M2-powered Mac minis in stock and on sale for $100-$150 off MSRP, each including free delivery: – Mac mini M2/256GB SSD: $499, save $100 – Mac mini M2/512GB SSD: $699, save $100 –... Read more
Amazon is offering a $200 discount on 14-inch...
Amazon has 14-inch M3 MacBook Pros in stock and on sale for $200 off MSRP. Shipping is free. Note that Amazon’s stock tends to come and go: – 14″ M3 MacBook Pro (8GB RAM/512GB SSD): $1399.99, $200... Read more
Sunday Sale: 13-inch M3 MacBook Air for $999,...
Several Apple retailers have the new 13″ MacBook Air with an M3 CPU in stock and on sale today for only $999 in Midnight. These are the lowest prices currently available for new 13″ M3 MacBook Airs... Read more
Multiple Apple retailers are offering 13-inch...
Several 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... Read more
Roundup of Verizon’s April Apple iPhone Promo...
Verizon is offering a number of iPhone deals for the month of April. Switch, and open a new of service, and you can qualify for a free iPhone 15 or heavy monthly discounts on other models: – 128GB... Read more

Jobs Board

Relationship Banker - *Apple* Valley Financ...
Relationship Banker - Apple Valley Financial Center APPLE VALLEY, Minnesota **Job Description:** At Bank of America, we are guided by a common purpose to help Read more
IN6728 Optometrist- *Apple* Valley, CA- Tar...
Date: Apr 9, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92308 **Requisition ID:** 824398 At Target Optical, we help people see and look great - and Read more
Medical Assistant - Orthopedics *Apple* Hil...
Medical Assistant - Orthopedics Apple Hill York Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
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
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.